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

     
  • 相关阅读:
    poj 3074(DLX)
    zoj 3209(DLX)
    hdu 4531(模拟+BFS+DFS)
    hdu 2065(递推+矩阵优化)
    poj 3714 (最近点对)
    zoj 3690(递推+矩阵优化)
    poj 3076(DLX)
    hdu 4533(一种很巧妙的方法|线段树+扫描线)
    hdu 4513(模拟)
    sql server 2008 评估已过期。
  • 原文地址:https://www.cnblogs.com/peterinblog/p/7220828.html
Copyright © 2011-2022 走看看