1.安装
$ yum -y install docker
2.启动docker服务
$ systemctl start docker
3.设置开启自启
$ systemctl enable docker
4.查看版本信息
$ docker versionClient: Version: 1.13.1 API version: 1.26 Package version: docker-1.13.1-94.gitb2f74b2.el7.centos.x86_64 Go version: go1.10.3 Git commit: b2f74b2/1.13.1 Built: Tue Mar 12 10:27:24 2019 OS/Arch: linux/amd64Server: Version: 1.13.1 API version: 1.26 (minimum version 1.12) Package version: docker-1.13.1-94.gitb2f74b2.el7.centos.x86_64 Go version: go1.10.3 Git commit: b2f74b2/1.13.1 Built: Tue Mar 12 10:27:24 2019 OS/Arch: linux/amd64 Experimental: false
5.显示 Docker 系统信息,包括镜像和容器数。
$ docker infoContainers: 0 Running: 0 Paused: 0 Stopped: 0Images: 0Server Version: 1.13.1Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: false……
6.从Docker Hub中搜索合适的镜像(以centos为例)
$ docker search centos
7.下载镜像(从公网docker hub拉取(下载)image)
$ docker pull docker.io/centos
8.查看本地镜像
$ docker images