Docker中免去sudo的设置方法
-
Add the docker group if it doesn't already exist:
sudo groupadd docker -
Add the connected user "$USER" to the docker group. Change the user name to match your preferred user if you do not want to use your current user:
sudo gpasswd -a $USER docker -
Either do a
newgrp dockeror log out/in to activate the changes to groups. -
You can use
docker run hello-worldto check if you can run docker without sudo.

浙公网安备 33010602011771号