添加用户组,将用户添加到组,重启docker即可

[root@localhost ~]# groupadd docker
[root@localhost ~]# groups
root
[root@localhost ~]# usermod -a -G docker simon 
[root@localhost ~]# grep docker /etc/group
dockerroot:x:994:
docker:x:1001:simon
[root@localhost ~]# service docker restart
Redirecting to /bin/systemctl restart docker.service
[root@localhost ~]# sudo simon
[simon@localhost ~]$ docker image ls
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐