zoukankan      html  css  js  c++  java
  • howto:在构建基于debian的docker基础镜像时,更换国内包源

    debian经常被用作构建应用镜像的基础镜像,如微软在构建linux下的dotnetcore基础镜像时,提供了基于debian 8(jessie)和debian 9(stretch)的镜像。

    由于这些镜像采用的官方包源在国内的访问速度问题,我们在基于aspnet或者dotnet构建镜像时,通常需要将其替换为国内的包源,从而提升镜像构建的速度和成功率。

    更改包源的Dockerfile指令如下:

    # 更新阿里云的wheezy版本包源
    RUN echo "deb http://mirrors.aliyun.com/debian wheezy main contrib non-free" > /etc/apt/sources.list && 
        echo "deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free" >> /etc/apt/sources.list  && 
        echo "deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free" >> /etc/apt/sources.list && 
        echo "deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free" >> /etc/apt/sources.list && 
        echo "deb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free" >> /etc/apt/sources.list && 
        echo "deb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free" >> /etc/apt/sources.list

    上述配置针对采用阿里云提供的debian 7(wheezy)的镜像源,如果采用jessie或者stretch的系统,可以替换wheezy关键词即可。
    如果采用网易提供的镜像源,将上述地址替换为:
        http://mirrors.163.com/debian/
  • 相关阅读:
    JDK1.0-缓冲流
    笔试错误1
    JVM 垃圾收集(转)
    Trie树和后缀树(转,简化)
    海量数据处理(转,简化)
    Struts2 内核之我见(转) -(主要是拦截器链和过滤链介绍和源码及其设计模式)
    phpize增加php模块
    Ubuntu下SVN安装和配置
    Linux下SVN配置hook经验总结
    Kruakal 算法——练习总结
  • 原文地址:https://www.cnblogs.com/dadream/p/8058641.html
Copyright © 2011-2022 走看看