[root@docker ~]# uname -r
3.10.0-957.el7.x86_64
[root@docker ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
準備好一臺 Linux 作業系統的主機,設定好相關網路引數,實現可以正常通訊;這裡我用的是 CentOS7.6。
主機 | 服務 | 設定 |
---|---|---|
docker | docker服務 | 1C1G |
#下載 docker 源
[root@docker ~]# yum install -y wget
[root@docker ~]# wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
- 安裝並啟動 Docker
#下載 docker
[root@docker ~]# yum install -y docker
#啟動 docker
[root@docker ~]# systemctl start docker
#驗證
[root@docker ~]# docker version
Client:
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-162.git64e9980.el7.centos.x86_64
Go version: go1.10.3
Git commit: 64e9980/1.13.1
Built: Wed Jul 1 14:56:42 2020
OS/Arch: linux/amd64
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.1-162.git64e9980.el7.centos.x86_64
Go version: go1.10.3
Git commit: 64e9980/1.13.1
Built: Wed Jul 1 14:56:42 2020
OS/Arch: linux/amd64
Experimental: false
{
"registry-mirrors": ["https://3290299n.mirror.aliyuncs.com"]
}
[root@docker ~]# cat > /etc/docker/daemon.json << EOF
> {
> "registry-mirrors": ["https://3290299n.mirror.aliyuncs.com"]
> }
> EOF
[root@docker ~]# systemctl daemon-reload
[root@docker ~]# systemctl restart docker