1.安装

$ yum -y install docker

2.启动docker服务

$ systemctl start docker

3.设置开启自启

$ systemctl enable docker

4.查看版本信息

$ docker version
Client:
Version: 1.13.
API version: 1.26
Package version: docker-1.13.-.gitb2f74b2.el7.centos.x86_64
Go version: go1.10.3
Git commit: b2f74b2/1.13.
Built: Tue Mar ::
OS/Arch: linux/amd64 Server:
Version: 1.13.
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.-.gitb2f74b2.el7.centos.x86_64
Go version: go1.10.3
Git commit: b2f74b2/1.13.
Built: Tue Mar ::
OS/Arch: linux/amd64
Experimental: false

5.显示 Docker 系统信息,包括镜像和容器数。

$ docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 1.13.
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: false
……

6.从Docker Hub中搜索合适的镜像(以centos为例)

$ docker search centos

Linux Docker的部署-LMLPHP

7.下载镜像(从公网docker hub拉取(下载)image)

$ docker pull docker.io/centos

8.查看本地镜像

$ docker images
05-07 12:02