如下下 Docker 官方文档的说明: html
The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can access it with sudo. For this reason, docker daemon always runs as the root user. To avoid having to use sudo when you use the docker command, create a Unix group called docker and add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group.
sudo groupadd docker
sudo gpasswd -a ${USER} docker
下面是 CentOS7 的命令,其余系统详见 Docker 官方文档:linux
# 下面是CentOS7的命令,其余系统详见 Docker 官方文档 sudo systemctl restart docker
# 运行docker命令 docker ps 查看已运行的容器 docker ps # 运行docker命令 docker images 查看已下载的镜像 docker images
参考文档:docker
· Docker 官方文档:https://docs.docker.com/engine/installation/bash
· Linux 命令大全:http://man.linuxde.net/socket
本文为博主原创文章,转载请注明出处!this