通过国内镜像安装和配置Docker

通过国内镜像安装和配置Docker

官方方式安装-Install Docker Engine

脚本自动安装

1
2
3
4
5
export DOWNLOAD_URL="https://mirrors.tuna.tsinghua.edu.cn/docker-ce"
# 如您使用 curl
curl -fsSL https://get.docker.com/ | sudo -E sh
# 如您使用 wget
wget -O- https://get.docker.com/ | sudo -E sh

配置国内镜像源

1
2
3
4
5
6
7
8
9
{
    "registry-mirrors": [
        "https://registry.hub.docker.com",
        "http://hub-mirror.c.163.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://registry.docker-cn.com",
        "https://registry.hub.docker.com"
    ]
}
1
2
3
4
5
1.Docker中国区官方镜像
https://registry.docker-cn.com

2.网易
http://hub-mirror.c.163.com

安装portainer

1
2
#启动Portainer
docker run -dit -p 9000:9000 -v /root/portainer:/data -v /var/run/docker.sock:/var/run/docker.sock --name portainer portainer/portainer:latest

安全问题

Docker启用TLS加密解决暴露2375端口引发的安全漏洞