docker使用记录

来源:互联网 发布:网站排名优化学习 编辑:程序博客网 时间:2024/05/11 14:55

环境:Ubuntu16.04 64-bit
安装教程:https://docs.docker.com/engine/installation/linux/ubuntulinux/
安装成功后测试

$ sudo service docker start$ sudo docker run hello-world

结果
这里写图片描述

建立用户组
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 usermod -aG docker $USER//log out and log back in$ docker run hello-world

如果运行正确说明建立成功,以后都可以用现在这个账户直接使用docker不用sudo。

1 0
原创粉丝点击