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"]

這樣以后安軟件就快了。

回到目錄


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM