The steps are as follows1. Create a docker group: sudo groupadd docker 2. Add the current user to the docker group: sudo gpasswd -a ${USER} docker 3. Restart the service: sudo service docker restart 4. Refresh docker members: newgrp - docker [Note]: This has been tested on Ubuntu, not on other Linux systems. Supplement: Docker installation under Linux, and configuration to execute Docker without sudo command InstallExecute the following command wget -qO- https://get.docker.com/ | sh Execute docker without sudo command Why do we need to create a docker user group?The Docker daemon binds to a unix socket, not a TCP port. The default owner of this socket is root, and other users can use the sudo command to access this socket file. For this reason, the Docker service process runs as the root account. To avoid having to enter sudo every time you run a docker command, you can create a docker user group and add the corresponding users to this group. When the docker process starts, the socket is set to be readable and writable by users of the docker group. In this way, any user in the docker group can directly execute docker commands. Warning: This dockergroup is equivalent to the root account. For more details, please refer to this article: Docker Daemon AttackSurface . 1 Log in to the system using an account with sudo privileges. 2 Create a docker group and add the corresponding users to this group. sudo usermod -aG docker your_username 3 Log out and then log in again for the permissions to take effect. 4 Confirm that you can run docker commands directly. $ docker run hello-world The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me. You may also be interested in:
|
<<: Solution to MySQL replication failure caused by disk fullness
>>: Mini Program Custom TabBar Component Encapsulation
The definition and inheritance of classes in JS a...
It is very convenient to configure virtual host v...
nbsp   no-break space = non-breaking spa...
Table of contents What are shallow cloning and de...
1. Purpose Write a Flask application locally, pac...
This article shares with you the solution to the ...
Table of contents What is a trigger Create a trig...
No more nonsense, post code HTML part <div cla...
In the previous article, after using openssl to g...
This article shares the specific code of JavaScri...
Use "onInput(event)" to detect whether ...
"The great river flows eastward, the waves w...
How is the MySQL Select statement executed? I rec...
This tutorial shares the installation tutorial of...
As a front-end monkey, whether it is during an in...