工具与环境【docker 安装】docker多系统的安装windows、ubutun等系统下docker的安装阿里云服务器Ubutun上docker安装安装依赖1 apt install -y apt-transport-https ca-certificates curl software-properties-common 添加阿里云镜像1 2 3 curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null 更新源1 apt update 安装docker1 apt install -y docker-ce docker-ce-cli containerd.io 验证安装成功1 docker --version 阿里云服务器docker配置镜像加速创建/etc/docker目录1 mkdir -p /etc/docker 写入镜像地址1 2 3 4 5 6 7 tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": [ "https://docker.m.daocloud.io" ] } EOF 重启docker1 systemctl daemon-reload && systemctl restart docker 阿里云服务器为docker配置本地代理创建/etc/systemd/system/docker.service.d文件1 mkdir -p /etc/systemd/system/docker.service.d 查看文件内容并且写入1 2 3 4 5 cat > /etc/systemd/system/docker.service.d/proxy.conf << 'EOF' [Service] Environment="HTTP_PROXY=http://127.0.0.1:7890" Environment="HTTPS_PROXY=http://127.0.0.1:7890" EOF 重启docker1 systemctl daemon-reload && systemctl restart docker 验证代理是否生效1 systemctl show --property=Environment docker # 出现这个表示成功Environment=HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 Windows安装安装WSL下载docker桌面版 并且配置镜像源 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "builder": { "gc": { "defaultKeepStorage": "20GB", "enabled": true } }, "experimental": false, "registry-mirrors": [ "https://docker.m.daocloud.io", "https://lispy.org", "https://docker-0.unsee.tech", "https://docker.xuanyuan.me" ] }
评论
评论区加载中...