from: http://stackoverflow.com/questions/23111631/cannot-download-docker-images-behind-a-proxy

That's an old subject, but I'll give my two cents in case someone else is looking for advice.

Here is a link to the official docker doc for proxy http:https://docs.docker.com/engine/admin/systemd/#http-proxy

A quick outline:

First, create a systemd drop-in directory for the docker service:

mkdir /etc/systemd/system/docker.service.d

Now create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"

If you have internal Docker registries that you need to contact without proxying you can specify them via the NO_PROXY environment variable:

Environment="HTTP_PROXY=http://proxy.example.com:80/"
Environment="NO_PROXY=localhost,127.0.0.0/8,docker-registry.somecorporation.com"

Flush changes:

$ sudo systemctl daemon-reload

Verify that the configuration has been loaded:

$ sudo systemctl show --property Environment docker
Environment=HTTP_PROXY=http://proxy.example.com:80/

Restart Docker:

$ sudo systemctl restart docker

Docker configure http proxy的更多相关文章

  1. docker squid---but git proxy should specify by git config --global http.proxy http:...

    Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.t ...

  2. Configure a proxy for your API calls with Angular CLI

    Table of contents Local development setup with Angular Issue: Dev server plus backend API Configurin ...

  3. 【Android Studio错误】 If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.

    解决办法:以管理员身份运行cmd窗口,输入命令“netsh winsock reset” netsh winsock reset命令,作用是重置 Winsock 目录.如果一台机器上的Winsock协 ...

  4. docker官方文档学习-1-Docker for mac安装配置

    https://docs.docker.com/docker-for-mac/ Get started with Docker for Mac 首先像在本博客docker-1-环境安装及例子实践处将环 ...

  5. 2.使用nexus3配置docker私有仓库

    1,配置走起 1,创建blob存储 登陆之后,先创建一个用于存储镜像的空间. 定义一个name,下边的内容会自动补全. 然后保存. 注意:实际生产中使用,建议服务器存储500G或以上. 2,创建一个h ...

  6. Install Docker on Ubuntu

    Install Docker on Ubuntu Estimated reading time: 17 minutes Docker is supported on these Ubuntu oper ...

  7. Docker - 在CentOS 7中安装Docker

    1-确认系统信息 # cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) # uname -a Linux CentOS-7 3. ...

  8. docker --- 初识

    Docker简介 Docker是一个开源的引擎,可以轻松的为任何应用创建一个轻量级的.可移植的.自给自足的容器.开发者在笔记本上编译测试通过的容器可以批量地在生产环境中部署,包括VMs(虚拟机).ba ...

  9. ubuntu环境下docker安装步骤

    本文是根据docker官方文档翻译,原文:https://docs.docker.com/engine/installation/linux/ubuntulinux/ Docker 支持以下 Ubun ...

随机推荐

  1. Robot Framework--11 RF结合Jenkins

    转自:http://blog.csdn.net/tulituqi/article/details/17846463 为什么我们要引入RF?其实最初我们引入RF是为了能够快速的开展自动化验收测试,为敏捷 ...

  2. JS获取字符串实际长度(包含汉字)

    方法一: var jmz = {}; jmz.GetLength = function(str) { ///<summary>获得字符串实际长度,中文2,英文1</summary&g ...

  3. Ftp软件

    http://www.xlightftpd.com/cn/index.htm FileZilla Server官网:http://www.filezilla-project.org/

  4. svn 回滚到某个版本

    用svn merge命令来进行回滚. 回滚的操作过程如下: 1.保证我们拿到的是最新代码: svn update 假设最新版本号是28. 2.然后找出要回滚的确切版本号: svn log 假设根据sv ...

  5. oracle 的wm_concat函数使用

    转载自:http://blog.itpub.net/post/42245/522757 首先让我们来看看这个神奇的函数wm_concat(列名),该函数可以把列值以","号分隔起来 ...

  6. Oracle 中count(1) 和count(*) 的区别

    count()与count(*)比较: 如果你的数据表没有主键,那么count()比count(*)快 如果有主键的话,那主键(联合主键)作为count的条件也比count(*)要快 如果你的表只有一 ...

  7. webservice报错Message part refundRequest was not recognized. (Does it exist in service WSDL?)

    最近在做一个支付的接口. 因为接口方使用webservice交互.  我只能去学习了下webservice 现在出了一个很古怪的问题~  我在请求他们url的时候, 返回给我找不到控制名错误 Mess ...

  8. Android Studio-设置放大代码编辑区

    原有的快捷键是ctrl+shift+F12,现在我修改成了Ctrl+M.

  9. SVN Tree Conflict 的分析

    所谓Tree Confict,就是至少有一个人修改了目录结构,包括文件或者文件所在目录的改名.删除.移动.然后Update或Merge的时候就报了Tree Conflict. 介绍一下概念Delete ...

  10. C语言内存管理(转)

    伟大的Bill Gates 曾经失言: 640K ought to be enough for everybody — Bill Gates 1981 程序员们经常编写内存管理程序,往往提心吊胆.如果 ...