Docker Pull downloads images through HTTP proxies

1. Modify the/etc/systemd/system/multi – user. Target. Wants/docker. Service

Vi/etc/systemd/system/multi - user. Target. Wants/docker. The service and then join the proxy configuration under the service, such as: the Environment = HTTP_PROXY = HTTP:/ / admin: [email protected]:1080
Environment=HTTPS_PROXY=http:/ / admin: [email protected]:1080
Environment=NO_PROXY=localhost,127.0. 01.
Copy the code

2. Restart the docker

systemctl daemon-reload
systemctl restart docker
Copy the code

3. Try docker pull again

Docker pull redis:latestCopy the code

Docker set up private library and accelerated image

1. Modify the configuration

This part of the content is actually unrelated to the content of 1, just want to record in a paper, no longer open a new article, record how to set up through the private library pull and accelerated pull configuration

/etc/docker cat > /etc/docker/daemon.json <<EOF {"exec-opts": ["native.cgroupdriver=systemd"]."log-driver": "json-file"."log-opts": {
    "max-size": "100m"."max-file":"1"
  },
  "storage-driver": "overlay2"."storage-opts": [
    "overlay2.override_kernel_check=true"]."insecure-registries": ["192.168.56.101:5000"]."registry-mirrors": ["https://qtytpky9.mirror.aliyuncs.com"} EOF ## then restart the DockerCopy the code

Registries: specifies the address of the registry. Registry -mirrors: specifies the address of the official website. Log-driver: specifies the log-opts of the docker log in json format. Parameter Description Value live-restore: If the value is set to true, the docker will be restarted while the docker is running

2. Pull the private database image

# # the private library mirror pull through the following way such as: docker pull 192.168.56.101:5000 / mysql: the latestCopy the code