随笔 - 59  文章 - 20  评论 - 61  阅读 - 85494

Asp.Net Core Docker镜像更新系统从wheezy改为stretch

之前写过一个在Asp.Net Core里调用System.Drawing.Common绘图的DEMO,部署到Docker里运行,需要更新Asp.Net Core镜像的操作系统。

https://www.cnblogs.com/sunnytrudeau/p/9384620.html

当时用的阿里云的源

1
2
3
4
5
6
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

  

最近再次跑这个Demo,居然不好使了,更新系统无效了,创建容器失败:

Step 4/11 : RUN apt-get update

 ---> Running in 69abe26c3b35

Ign:1 http://mirrors.aliyun.com/debian wheezy InRelease

Ign:2 http://mirrors.aliyun.com/debian wheezy Release

Ign:3 http://mirrors.aliyun.com/debian wheezy/deb all Packages

……

Ign:14 http://mirrors.aliyun.com/debian wheezy/http://mirrors.aliyun.com/debian amd64 Packages

Reading package lists...

W: The repository 'http://mirrors.aliyun.com/debian wheezy Release' does not have a Release file.

E: Failed to fetch http://mirrors.aliyun.com/debian/dists/wheezy/non-free/binary-amd64/Packages  404  Not Found [IP: 124.203.224.198 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.

ERROR: Service 'myweb' failed to build: The command '/bin/sh -c apt-get update' returned a non-zero code: 100

 

百度学习了一下,才知道Asp.Net Core的Docker镜像是基于debian这个Linux发行版构建的,以前用的版本是wheezy,现在用的新版本是stretch

版本号以及代号     发布日期

7 wheezy            2013年5月4日

8 Jessie             2015年4月26日

9 stretch            2017年06月17日

 

所以,更新操作系统的源相应的更换一下就可以了。

1
2
3
4
5
6
7
8
RUN echo "deb http://mirrors.aliyun.com/debian stretch main contrib non-free \
deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free \
deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free \
deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free \
deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free \
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free \
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib \
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib" > /etc/apt/sources.list

  

可以进入运行中的Asp.Net Core容器查看操作系统版本

[root@localhost ~]# docker exec -it fd70cac69589 /bin/bash

root@fd70cac69589:/app# cat /etc/issue

Debian GNU/Linux 9 \n \l

 

posted on   SunnyTrudeau  阅读(860)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示