zoukankan      html  css  js  c++  java
  • docker容器内部设置apt源和网络代理

    docker容器内部设置apt源和网络代理

    # 进入容器,并更新容器的apt源
    [root@server01 ~]# docker exec -it mynginx /bin/bash

    # 更新nginx的apt源
    tee /etc/apt/sources.list << EOF
    deb http://mirrors.163.com/debian/ jessie main non-free contrib
    deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib
    EOF

    # 相关的debian镜像站

    tee /etc/apt/sources.list << EOF
    deb http://ftp.hk.debian.org/debian/ jessie main non-free contrib
    deb http://ftp.hk.debian.org/debian/ jessie-updates main non-free contrib
    EOF


    全球debian镜像站列表

    https://www.debian.org/mirror/list.zh-cn.html

    设置apt-get的代理
    cd /etc/apt
    echo 'Acquire::http::Proxy "http://10.11.0.148:808";' >> apt.conf
    echo 'Acquire::https::proxy "http://10.11.0.148:808";' >> apt.conf



    # 使用apt-get update -y 经常报错如下,并且下载老是在98%的时候暂停,一直如此,可能是nginx依赖的容器底层的debian系统太老,更换nginx版本为最新

    E: Some index files failed to download. They have been ignored, or old ones used instead
    rm /var/lib/apt/lists/* -vrf

    # 安装 ping 和 ifconfig 命令
    apt-get update && apt-get install iputils-ping && apt-get install net-tools

  • 相关阅读:
    【原创】Cookie应用(二)
    空间数据可视化
    jquery 相册
    两个时间的月份差
    SQL2005 分页
    mssql 评估期过了
    获得文件夹内的文件,按时间排序
    linux使用privoxy将55转为http代理
    OpenCV之创建矩阵并画绿色矩形
    vs2010导入vc 6.0的资源文件方法
  • 原文地址:https://www.cnblogs.com/reblue520/p/13492930.html
Copyright © 2011-2022 走看看