Docker using non-root users

Source: Internet
Author: User
Tags docker ps
Docker using non-root users

Usually we use root when using Docker, the official statement is as follows:

The Docker daemon binds to a Unix socket instead of a TCP port. By default, Unix socket is owned by the user root and other users can access it with sudo. For this reason, Docker Daemon always runs as the root user.
To avoid the Docker command, create a Unix group called Docker and add users to it. When the Docker daemon starts, it makes the ownership to the Unix socket read/writable by the Docker group.

The following is a procedure to create a docker group using a non-root user action

sudo groupadd Docker
Add the current user to the Docker group
sudo gpasswd-a ${user} docker
Restart the Docker service (below is the CentOS7 command)
sudo systemctl restart Docker
The current user exits the system and logs back in Run Docker command
Docker PS

Reprint please indicate this link form link
This article link: http://blog.csdn.net/kongxx/article/details/52413332

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.