CentOS7 安装docker
CentOS7安装docker-ce使用国内源
yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo yum makecache fast yum install -y docker-ce docker-ce-cli containerd.io systemctl enable docker systemctl start docker
docker version
docker run hello-world
系统提示
Unable to find image 'hello-world:latest' locally docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fhello-world%3Apull&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers). See 'docker run --help'.
需要使用国内加速器,注册并登陆阿里云开发者平台之后,在首页点击“创建我的容器镜像”,然后在阿里云服务面板中点击加速器标签。
根据提示输入Docker登录时需要使用的密码(后期可更改),用户名就是登录阿里云的用户名。在出现的页面中可以得到一个专属的镜像加速地址
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://9xtainqf.mirror.aliyuncs.com"] } EOF systemctl daemon-reload systemctl restart docker
docker images
本站所有文章均可随意转载,转载时请保留原文链接及作者。