zoukankan      html  css  js  c++  java
  • docker-1

    1、必须是用sudo启动服务,不然报接入拒绝。

    sudo usermod -aG docker <username>
    还需要推出登录后,重进。

     2、docker使用proxy pull

    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://21.21.21.1:3128/"
    

    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 docker --property Environment
    Environment=HTTP_PROXY=http://proxy.example.com:80/
    

    Restart Docker:

    $ sudo systemctl restart docker



    3、添加ubuntu update 代理

    在/etc/apt/apt.conf.d目录下新建10proxy文件,如sudo vi /etc/apt/apt.conf.d/10proxy,添加如下代理配置项

    Acquire::http::proxy "http://190.50.253.102:3128";

    Acquire::https::proxy "https://190.50.253.102:3128";

    4、pip proxy配置

    在/ubuntu/.pip/文件夹下创建(没有则新建)创建pip.conf文件

    配置为

    [global]
    trusted-host=pypi.python.org
    index-url=http://pypi.python.org/simple

    proxy=http://proxyIp:port

     5、进入docker

    docker run -it haha /bin/bash

     
  • 相关阅读:
    extjs grid renderer用法
    EventListenerList举例
    SQL语句的执行原理
    WPF操作邮箱,发送邮件
    wpf中DataGrid行色变换
    JS获取浏览器和荧屏分辨率
    将数据库的二进制字节转换成图片
    字符串操作类
    ios推送基于YII第三方组件的类库
    数组操作类
  • 原文地址:https://www.cnblogs.com/peterinblog/p/7220828.html
Copyright © 2011-2022 走看看