安装完成后有个提示:
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:
sudo usermod -aG docker runoob
Remember that you will have to log out and back in for this to take effect!
当要以非root用户可以直接运行docker时,需要执行 sudo usermod -aG docker runoob 命令,然后重新登陆
2、启动docker 后台服务
runoob@runoob:~$ sudo service docker start
查看后台运行的进程
ps -ef | grep docker
3、测试运行hello-world
runoob@runoob:~$ docker run hello-world
/////////////////////
docker --help
-ubuntu:~$ docker --version
Docker version 17.05.0-ce, build 89658be
-ubuntu:~$ docker version
Client:
Version: 17.05.0-ce
API version: 1.29
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 22:10:54 2017
OS/Arch: linux/amd64
Server:
Version: 17.05.0-ce
API version: 1.29 (minimum version 1.12)
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 22:10:54 2017
OS/Arch: linux/amd64
Experimental: false
////////////////////////////////////////////////////
Share images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/
-ubuntu:~$ docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
cfc728c1c558: Pull complete
Digest: sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96
Status: Downloaded newer image for alpine:latest
The pull command fetches the alpine image from the Docker registry and saves it in our system. You can use the docker images command to see a list of all images on your system.
-ubuntu:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
alpine latest 02674b9cb179 13 days ago 3.99MB
hello-world latest 48b5124b2768 4 months ago 1.84kB