一般对于安装软件加速时,我们大多数会选择阿里云,而对于aspnetcore2.0这个进项来说,由于使用的是Debian操作系统,所有我们要找到它对应的mirror列表,下面是我整理的一个sources.list加速列表,我们把它放在和Dockerfile相同的位置,在Dockerfile生成镜像时把它复制到里面去,替换之前的apt-update地址源即可。

source.list内容

deb http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free

然后我们对Dockerfile进行一些修改,在生成镜像时把它复制到镜像里

FROM microsoft/aspnetcore:2.0
ARG source
COPY sources.list /etc/apt/sources.list
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
RUN apt-get update && apt-get -y install libgdiplus
WORKDIR /app
EXPOSE
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "SMS.dll"]

然后我们再去生成镜像,就会非常非常快了!

当然,你也可以不添加这个文件,而直接把文本覆盖到原来的source.list文件里

FROM microsoft/aspnetcore:2.0
ARG source RUN echo "deb http://mirrors.aliyun.com/debian wheezy main contrib non-free \
deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free \
deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free \
deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free \
deb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free \
deb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free" > /etc/apt/sources.list RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
RUN apt-get update && apt-get install libgdiplus -y
WORKDIR /app
EXPOSE
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "Pilipa.SMS.dll"]

上面的做法也是完全没有问题的!

你要是在阿里云服务器上,那就是内网对内网,更快!

docker~aspnetcore2.0镜像安装软件的加速器的更多相关文章

  1. docker~aspnetcore2.0镜像缺少libgdiplus问题

    回到目录 对于微软官方提供的镜像microsoft/aspnetcore2.0来说,它没有安装libgdiplus包,所以当你使用了draw去画图时,就会出现一些问题,我们一般会安装第三方的包包,ZK ...

  2. Docker的ubuntu镜像安装的容器无ifconfig和ping命令的解决

    Docker的Ubuntu镜像安装的容器无ifconfig命令和ping命令 解决: apt-get update apt install net-tools       # ifconfig apt ...

  3. centos7配置本地yum源 使用安装镜像安装软件

    1. 在cdrom挂载安装镜像.(物理机则插入光盘,虚拟机则在CD/DVD中选择iso镜像.如果虚拟机mount时提示找不到则在选择iso镜像上方勾选“已连接”和“启动时连接”,或者点击 虚拟机下方状 ...

  4. docker image ubuntu12.04 安装软件源

    docker 容器为ubuntu12.04 ,无法添加软件源. apt-get install python-software-properties software-properties-commo ...

  5. Docker的Ubuntu镜像安装的容器无ifconfig命令和ping命令

    就这三步骤,下面的是实例不看也罢. apt-get update ###第一步一定要先执行这个更新下.不更新下面的安装命令会显示找不到网络包 //ifconfig apt install net-to ...

  6. Docker PHP7官方镜像安装Redies扩展

    2019独角兽企业重金招聘Python工程师标准>>> 直接RUN docker-php-ext-install redis 失败,google得到: ENV PHPREDIS_VE ...

  7. 使用docker加载已有镜像安装Hyperledger Fabric v1.1.0

    背景 每次在新的服务器上安装Hyperledger Fabric网络时,通过fabric官方提供的脚本安装时,需要从网络上down下近10G的fabric相关镜像,这个过程是漫长及痛苦的,有时因网络问 ...

  8. 【docker】【mysql】docker安装mysql,阿里云docker镜像加速器,docker搜索查看远程仓库上的镜像,docker拉取镜像,查看本地所有镜像,查看容器的运行状况,查看容器的详细信息

    在docker上安装mysql有两种方式 1.通过Dockerfile构建 2.直接在docker hub上拉取镜像安装 =================本篇采用方法2=============== ...

  9. Spring Boot 2.0(六):使用 Docker 部署 Spring Boot 开源软件云收藏

    云收藏项目已经开源2年多了,作为当初刚开始学习 Spring Boot 的练手项目,使用了很多当时很新的技术,现在看来其实很多新技术是没有必要使用的,但做为学习案例来讲确实是一个绝佳的 Spring ...

随机推荐

  1. shell入门-sed-2替换功能

    sed的替换功能和vim语法挺像的 把1到10行的nologin替换成login [root@wangshaojun ~]# sed '1,10s/nologin/login/g' 1.txt roo ...

  2. K.I.S.S 原则

    KEEP IT SIMPLE, STUPID! 编写只做一件事情,并且要做好的程序:编写可以在一起工作的程序,编写处理文本流的程序,因为这是通用的接口.这就是UNIX哲学.所有的哲学真 正的浓缩为一个 ...

  3. .clearfix:after

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. 菜鸟级的Git与GitHub使用总结(转)

    菜鸟级的Git与GitHub使用总结 原创 2016年12月01日 14:58:30 1792 前言 这几天一直在折腾学习Git和GitHub的使用.几天下来,在网上查阅了大量的资料,总算有一些成果. ...

  5. HDFS内容追加

    配置:hdfs-site.xml <property> <name>dfs.support.append</name> <value>true</ ...

  6. Coding 如何使用 Coding 开发 Coding

    Coding Anytime Anywhere Coding 团队有 70 多人,分布在全国各地(深圳,北京,上海,成都),我们使用 Coding 作为云端办公室,以云端协作的方式管理事务,文件等,我 ...

  7. uWSGI + Nginx + Django 部署

    1. uWSGI 服务器 Django 默认使用 WSGI(Python Web Server Gateway ) 作为 Web 服务器,一般仅用来作为测试使用,实际生产环境而是使用 uWSGI 和 ...

  8. 【redis对象,集合序列化Demo】

    package org.seckill.dao.cache; import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStr ...

  9. GridView 高亮某一行

    <script type="text/javascript"> $(document).ready(function () { $("#GridView tr ...

  10. JavaScript -- 实现密码加密的几种方案

    base64加密 页面中引入base64.js var base=new Base64(); var str=base.encode('admin:admin'); //解密用: str=b.deco ...