1. 程式人生 > >DotNetCore跨平臺~為debain系統新增阿里雲加速

DotNetCore跨平臺~為debain系統新增阿里雲加速

回到目錄

直接把它阿里雲的映象覆蓋到原來的/etc/apt/sources.list檔案

cat > /etc/apt/sources.list << EOF
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-proposed-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-proposed-updates main non-free contrib EOF

這樣再進行apt-get update就快了

apt-get install就可以安裝你的程式了,在dockefile裡也可以把它新增,方便你的容器裡安裝軟體,這樣可以一勞永逸!

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

這樣以後安軟體就快了。

回到目錄