Hello from Docker! This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/
For more examples and ideas, visit: https://docs.docker.com/get-started/
Hello from Docker! This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/
For more examples and ideas, visit: https://docs.docker.com/get-started/
4.5 查看 Docker 版本
1 2
[root@localhost home]# docker -v Docker version 18.09.0, build 4d60db4
5 启动与停止 Docker 服务
systemctl 命令是系统服务管理器指令,它是 service 和 chkconfig 两个命令组合。
[root@localhost home]# systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) Active: active (running) since Wed 2019-01-16 21:43:18 EST; 55min ago Docs: https://docs.docker.com Main PID: 7950 (dockerd) Tasks: 14 Memory: 35.0M CGroup: /system.slice/docker.service └─7950 /usr/bin/dockerd -H unix://
Jan 16 21:43:17 localhost.localdomain dockerd[7950]: time="2019-01-16T21:43:17.834575284-05:00" level=info msg="Graph migration to content-addressability... seconds" Jan 16 21:43:17 localhost.localdomain dockerd[7950]: time="2019-01-16T21:43:17.835788542-05:00" level=info msg="Loading containers: start." Jan 16 21:43:17 localhost.localdomain dockerd[7950]: time="2019-01-16T21:43:17.956042119-05:00" level=info msg="Default bridge (docker0) is assigned with... address" Jan 16 21:43:17 localhost.localdomain dockerd[7950]: time="2019-01-16T21:43:17.996025653-05:00" level=info msg="Loading containers: done." Jan 16 21:43:18 localhost.localdomain dockerd[7950]: time="2019-01-16T21:43:18.023462688-05:00" level=info msg="Docker daemon" commit=4d60db4 graphdriver...n=18.09.0 Jan 16 21:43:18 localhost.localdomain dockerd[7950]: time="2019-01-16T21:43:18.023574853-05:00" level=info msg="Daemon has completed initialization" Jan 16 21:43:18 localhost.localdomain dockerd[7950]: time="2019-01-16T21:43:18.024467667-05:00" level=warning msg="Could not register builder git source:...in $PATH" Jan 16 21:43:18 localhost.localdomain dockerd[7950]: time="2019-01-16T21:43:18.030610952-05:00" level=info msg="API listen on /var/run/docker.sock" Jan 16 21:43:18 localhost.localdomain systemd[1]: Started Docker Application Container Engine. Jan 16 21:43:48 localhost.localdomain dockerd[7950]: time="2019-01-16T21:43:48.475953192-05:00" level=info msg="ignoring event" module=libcontainerd name...skDelete" Hint: Some lines were ellipsized, use -l to show in full.
5.5 设置开机启动
1 2
[root@localhost home]# systemctl enable docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.