Because the docker daemon needs to bind to the host's Unix socket instead of a normal TCP port, and the owner of the Unix socket is the root user, other users can perform related operations only by adding the sudo option before the command. If you don’t want to type sudo every time you use the docker command, you can configure it as follows. 1. Create a docker group
2. Add the current user to the docker group
3. Log out and log back into the shell 4. Verify that the docker command can run
Additional knowledge: Docker image acceleration After installing Docker, the next step is to have fun, but the actual situation is not pleasant Because the default image source of Docker is abroad, due to the special network reasons in China, it is often slow to access or completely inaccessible. Fortunately, there are similar image sources available in China. I use the image source provided by daocloud, and the experience is pretty good. Conveniently, they provide a script to modify the mirror source with one click. The specific commands are as follows:
After executing the above command, the default image source of docker points to the image warehouse of daocloud. At this time, you need to restart the docker service to take effect.
Try to pull an image
If the image is downloaded successfully, it means that the above changes have taken effect. Reference official website The above operation of using docker command without typing sudo is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Steps to install MySQL using Docker under Linux
>>: JavaScript to implement drop-down list selection box
For databases that have been running for a long t...
Table of contents 1. General steps for SQL optimi...
Table of contents 1. Error message 2. Cause of er...
Table of contents animate() animation method Anim...
Linux system version: CentOS7.4 MySQL version: 5....
DML operations refer to operations on table recor...
Root directory and index file The root directive ...
The table is as follows: Code when Unity reads an...
SQL implements addition, subtraction, multiplicat...
When connecting to the local database, navicat fo...
This article example shares the specific code of ...
Table of contents 1. Check the MySQL status in th...
I was in a meeting when a colleague called to rep...
Overview MySQL also has its own event scheduler, ...
This article records the process of upgrading MyS...