分类目录

链接

2020 年 11 月
 1
2345678
9101112131415
16171819202122
23242526272829
30  

近期文章

热门标签

新人福利,免费薅羊毛

现在位置:    首页 > LINUX > 正文
How to pull docker image behind proxy
LINUX 暂无评论 阅读(204)

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 dockerwork 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
......

============ 欢迎各位老板打赏~ ===========

【上篇】
【下篇】

本文版权归Bruce's Blog所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:How to pull docker image behind proxy | Bruce's Blog

发表评论

留言无头像?