官网:https://www.docker.com/ 镜像中心:https://hub.docker.com/

Docker 安装

官方文档:https://docs.docker.com/engine/install/ https://docs.docker.com/engine/install/centos/#install-using-the-convenience-script

使用脚本(两种方式):

  1. wget -qO- https://get.docker.com/ | sh
  1. curl -fsSL https://get.docker.com -o get-docker.sh
  2. sudo sh get-docker.sh

Docker 换源

临时换源

  1. 设置临时的 Docker CDN:$docker_cdn=***.mirror.aliyuncs.com
  2. 使用:docker pull $docker_cdn/library/nextcloud

永久换源(Linux)

  1. 编辑 /etc/docker/daemon.json,主要修改registry-mirrors

    1. {
    2. "registry-mirrors": ["https://***.mirror.aliyuncs.com"]
    3. }
    1. {
    2. "registry-mirrors": ["http://docker.mirrors.ustc.edu.cn", "http://hub-mirror.c.163.com", "http://registry.docker-cn.com"],
    3. "insecure-registries":["docker.mirrors.ustc.edu.cn", "registry.docker-cn.com"]
    4. }
  2. 重启 Docker 服务:

    1. systemctl daemon-reload
    2. systemctl restart docker