DockerHub镜像加速和代理
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。 配置加速地址
Ubuntu 16.04+、Debian 8+、CentOS 7+
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": [ "https://1nj0zren.mirror.aliyuncs.com", "https://docker.mirrors.ustc.edu.cn", "http://f1361db2.m.daocloud.io", "https://registry.docker-cn.com" ] } EOF sudo systemctl daemon-reload sudo systemctl restart docker
查看
docker info Experimental: false Insecure Registries: 127.0.0.0/8 Registry Mirrors: https://1nj0zren.mirror.aliyuncs.com/ https://docker.mirrors.ustc.edu.cn/ http://f1361db2.m.daocloud.io/ https://registry.docker-cn.com/ Live Restore Enabled: false WARNING: No swap limit support