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. centos 7.0 ln命令 和chkconfig 命令介绍 开机自动启 服务

    有时候centos需要 程序开机启动的时候  自启动 首先在 /etc/init.d/ cd /etc/init.d 文件夹下建立开机启动项 使用ln命令 使用方式 : ln [options] so ...

  2. Yii2.0-生成二维码实例

    原文地址:http://www.yii-china.com/post/detail/19.html

  3. Linq_Lambda GroupBy使用笔记

    今天看MVC遇到了GroupBY的Lambda表达式..有兴趣详细的看下去..得此笔记..记录之... 不罗嗦..上代码... //得到List<GroupEmail>对象 数据源 var ...

  4. C++ compile issue

    You can do so via right-click -> Properties on a file or a selection of files in Solution Explore ...

  5. #ifdef的用法【转】

    #ifdef的用法     #ifdef的用法灵活使用#ifdef指示符,我们可以区隔一些与特定头文件.程序库和其他文件版本有关的代码.代码举例:新建define.cpp文件 #include &qu ...

  6. Makefile的学习笔记

    Makefile的学习笔记 标签: makefilewildcard扩展includeshellfile 2012-01-03 00:07 9586人阅读 评论(2) 收藏 举报  分类: Linux ...

  7. 黄永成-thinkphp讲解-个人博客讲解25集

    整个网站的根目录用blog你要跟别人说起,自己好识别的文件夹名字. 下面的项目名称 就不再重复的写了, 直接用App就好了. 网站访问: ...../index.php(入口文件)/Admin(模块名 ...

  8. java.lang.Class

    java.lang.Class 一.Class类是什么 Class是一个类,位于java.lang包下. 在Java中每个类都有一个相对应的Class类的对象,换句话说:Java程序在启动运行时 一个 ...

  9. codeforces #270 ABCD

    Codeforces Round #270 A - Design Tutorial: Learn from Math 题意:给出n,求出两个合数x和y使x+y=n. 题解:暴力筛合数,然后暴力找 // ...

  10. C语言动态内存分配

    考虑下面三段代码: 片段1 void GetMemory(char *p) { p = (); } void Test(void) { char *str = NULL; GetMemory(str) ...