1.安装docker
在官网或者菜鸟教程有详细的步骤:https://www.runoob.com/docker/centos-docker-install.html
2.常见的问题
1)This system is not registered with an entitlement server.
yum出现问题,解决方案:https://www.jianshu.com/p/7f22bb72a681
2)测试hello-world出现问题(Unable to find image 'hello-world:latest' locally)
docker服务器再国外,我们在国内 无法正常拉取镜像,所以就需要我们为docker设置国内阿里云的镜像加速器;
解决方案:https://blog.csdn.net/qq_35606010/article/details/104750391
3)docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled
这个也是国外服务器的问题:解决方案如上:https://blog.csdn.net/qq_35606010/article/details/104750391
4)Job for docker.service failed because start of the service was attempted too often
解决方案:将/etc/docker下的daemon.json改成daemon.conf
mv daemon.json daemon.conf
5)Error response from daemon: Get https://index.docker.io/v1/search?q=nginx&n=25: read tcp 192.168.43.224:55732->50.16.172.3:443: read: connection reset by peer
网络配置问题,解决方案:修改Docker配置文件如下:
vi /etc/default/docker
DOCKER_OPTS="--registry-mirror=http://aad0405c.m.daocloud.io"