linux下安装docker

1、下载安装docker

[root@localhost ~]# yum -y install docker

2、启动docker

[root@localhost ~]# service docker start

3、检查docker是否安装成功

[root@localhost ~]# docker version
Client:
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-96.gitb2f74b2.el7.centos.x86_64
Go version: go1.10.3
Git commit: b2f74b2/1.13.1
Built: Wed May 1 14:55:20 2019
OS/Arch: linux/amd64
Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Package version: docker-1.13.1-96.gitb2f74b2.el7.centos.x86_64
Go version: go1.10.3
Git commit: b2f74b2/1.13.1
Built: Wed May 1 14:55:20 2019
OS/Arch: linux/amd64
Experimental: false

4、修改镜像源

[root@localhost ~]# vim /etc/docker/daemon.json
{
“registry-mirrors”: [“https://registry.docker-cn.com”]
}

这是docker官方国内镜像源
网易:http://hub-mirror.c.163.com

5、重启docker

[root@localhost ~]# service docker restart

你可能感兴趣的:(docker)