1、安装docker
[root@c741 ~]# yum install docker-ce
2、启动服务
[root@c741 ~]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@c741 ~]# systemctl start docker.service
3、配置镜像源
配置中科大的镜像源,没有文件新建文件
[root@c741 ~]# vi /etc/docker/daemon.json
{
"registry-mirrors":["https://docker.mirrors.ustc.edu.cn"]
}
也可以配置163或则阿里云的源
163的源如下所示
daemon.json
{
"registry-mirrors": ["http://hub-mirror.c.163.com"]
}
4、测试运行hello-world
[root@c741 docker]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull c