参考 https://docs.docker.com/engine/install/ubuntu/
安装 docker apt key
1 2 3 |
install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc chmod a+r /etc/apt/keyrings/docker.asc |
添加 docker 源
1 2 3 4 |
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
安装 docker
1 2 |
apt update apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin |
配置 docker 引擎代理
参考 https://docs.docker.com/config/daemon/proxy/
1 |
nano /etc/docker/daemon.json |
输入 json 格式配置
1 2 3 4 5 6 7 |
{ "proxies": { "http-proxy": "http://proxy.example.com:3128", "https-proxy": "https://proxy.example.com:3129", "no-proxy": "*.test.example.com,.example.org,localhost,127.0.0.0/8" } } |