ubuntu 安装docker,并设置docker 代理

安装docker 

如何在 Ubuntu 22.04 LTS 中安装 Docker 和 Docker Compose-如何在ubuntu上安装docker

问题1:

curl: (35) OpenSSL SSL_connect: Connection reset by peer in connection to download.docker.com:443

set -ex in shell script  +  set curl proxy

问题2:

当服务器通过代理连接外网时,docker pull 会出现问题,

Error response from daemon: Get "https://registry-1.docker.io/v2/": read tcp 10.32.97.179:41268->34.205.13.154:443: read: connection reset by peer

sudo mkdir -p /etc/systemd/system/docker.service.d
sudo touch /etc/systemd/system/docker.service.d/proxy.conf

sudo vim /etc/systemd/system/docker.service.d/proxy.conf
#输入以下内容,其中代理改成自己的
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:8080/"
Environment="HTTPS_PROXY=http://proxy.example.com:8080/"

sudo systemctl daemon-reload
sudo systemctl restart docker.service

你可能感兴趣的:(docker,容器,运维)