How to pull docker image behind proxy
My host OS is CENTOS7
, and running behind proxy. The output of executing docker run hello-world
is like this:
# docker run hello-world
Unable to find image 'hello-world:latest' locally
Trying to pull repository registry.access.redhat.com/hello-world ... failed
Trying to pull repository docker.io/library/hello-world ... failed
Error while pulling image: Get https://index.docker.io/v1/repositories/library/hello-world/images: x509: certificate is valid for FG3K6C3A15800021, not index.docker.io
It prompts pull image failed, so I need to configure proxy to make docker
work correctly:
(1) Add proxy info in /etc/sysconfig/docker
file:
HTTP_PROXY="http://web-proxy.corp.xxxxxx.com:8080"
HTTPS_PROXY="http://web-proxy.corp.xxxxxx.com:8080"
http_proxy="${HTTP_PROXY}"
https_proxy="${HTTPS_PROXY}"
(2) Restart docker service:
# service docker restart
Then docker
works OK now:
# docker run hello-world
Unable to find image 'hello-world:latest' locally
Trying to pull repository registry.access.redhat.com/hello-world ... not found
Trying to pull repository docker.io/library/hello-world ... latest: Pulling from library/hello-world
3f12c794407e: Pull complete
975b84d108f1: Pull complete
......
============ 欢迎各位老板打赏~ ===========
与本文相关的文章
- · k3s+kuboard快速搭建K8s生产环境集群
- · 解决es报错:blocked by: [FORBIDDEN/12/index read-only / allow delete (api) ]
- · filebeat按docker容器名创建不同的索引
- · traefik负载均衡/滚动升级
- · 定时备份docker中的mysql
- · 使用traefik做为docker网关(负载均衡/滚动更新)
- · 部署docker+k3s+rancher2
- · linux使用docker-compose安装和破解confluence 8.0.2
- · es+filebeat+elastalert2实现异常邮件提醒
- · docker安装neo4j
- · jenkinsfile
- · dial unix /var/run/docker.sock: connect: permission denied