Docker - Post-install steps
Manage Docker as a non-root user
Docker daemon binds to a Linux socket instead of a TCP port. By default that Unix socket is owned by the user "root" and other users can only access it using sudo. The docker daemon always runs as the root user.
To avoid using sudo , create a Unix group called docker and add users to it. When the Docker daemon starts, it creates a Unix socket accessible by members of the docker group.
The docker group grants privileges equivalent to the root user.
To create the docker group and add your user:
1. Create the docker group
sudo groupadd docker
2. Add your user to the docker group
sudo usermod -aG docker $USER
3.Logout and log back
4.Verify that you can run docker commands without sudo:
docker run hello-world
If you initially ran Docker CLI commands using sudo before adding your user to the docker group, you may see the following error, which indicates that your ~/.docker/ directory was created with incorrect permissions due to the sudo commands.
WARNING: Error loading config file: /home/user/.docker/config.json -
stat /home/user/.docker/config.json: permission denied
To fix this problem, either remove the ~/.docker/ directory (it is recreated automatically, but any custom settings are lost), or change its ownership and permissions using the following commands:
sudo chown "$USER":"$USER" /home/"$USER"/.docker -R sudo chmod g+rwx "$HOME/.docker" -R
Configure Docker to start on boot
Most current Linux distributions (RHEL, CentOS, Fedora, Ubuntu 16.04 and higher) use systemd to manage which services start when the system boots. Ubuntu 14.10 and below use upstart.
systemd
sudo systemctl enable docker
To disable this behavior, use disable instead.
sudo systemctl disable docker
upstart
Docker is automatically configured to start on boot using upstart. To disable this behavior, use the following command:
echo manual | sudo tee /etc/init/docker.override chkconfig sudo chkconfig docker on
8 comments:
Thanks for sharing this useful informative.I Got more information from this blog.Keep it up... Fixed Assets Audit
CFA Audit
CA Firms
Hi admin..... i have read your post.it was very useful.Thank you so much for sharing,Keep it up..... AR Customer Helpdesk
Duplicate Payment Recovery
Fraud Prevention
This blog is useful to enhance my knowledge about this technology.Thanks for sharing such a information
AWS Training in Anna nagar
DevOps Training in Anna nagar
AWS Course in Anna nagar
Devops Training in chennai
Blue Prism Training in Anna nagar
RPA Training in Anna nagar
Data Science Course in anna nagar
Data Science Training in anna nagar
This blog is very creativity and the admin providing the best content was many knowledgeable posts. I appreciate your great work and keep blogging!!!
Spark Training in Chennai
Spark Training
Pega Training in Chennai
Linux Training in Chennai
Social Media Marketing Courses in Chennai
Power BI Training in Chennai
Tableau Training in Chennai
Excel Training in Chennai
Oracle DBA Training in Chennai
Spark Training in Valachery
Excellent blog with unique content, thanks a lot for sharing this. I love to learn more about this topic.
Data Science Training in Chennai
Data Science Certification in Chennai
R Programming Training in Chennai
R analytics Training in Chennai
Machine Learning Training in Chennai
Machine Learning course
Data Science Training in Velachery
Data Science Course in Chennai
Nice Blog this is useful information thanks for sharing the post...
RPA training in bangalore
RPA courses in bangalore
RPA classes in bangalore
AWS training in bangalore
AWS courses in bangalore
AWS classes in bangalore
Post a Comment