请问各位同学,因历史遗留愿意,需把 py2 开发 django 的项目, docker build image ,问下,基于 alpine 来打包,不知稳定性如何, alpine 对 mysql- Python 支持如何,谢谢!

2022-04-21 10:00:09 +08:00
 boy461205160
1167 次点击
所在节点    问与答
7 条回复
echo1937
2022-04-21 10:06:07 +08:00
python2 的官方镜像应该能 pull 吧,选择 alpine 的出发点是什么呢?一般都推荐标准版

python:<version>
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
676529483
2022-04-21 10:45:49 +08:00
以前看过 alphine 的 python 貌似慢一点,我以前为了节省磁盘也用 alpine 的版本,后来发现直接用官方的 slim 版一样,调试还方便
yangyaofei
2022-04-21 11:27:52 +08:00
看用不用某些 C 库吧, alpine 如果需要装东西(特别是 GCC)之类的,就不推荐作为构建了,不如 slim 来的好
ospider
2022-04-21 11:30:22 +08:00
没事儿别用 alpine ,坑多而且慢,为了省一点硬盘空间不值当的。
Symo
2022-04-21 11:36:26 +08:00
建议用 debian slim, alpine 没有 gcc
musl 在 k8s 上会有一些奇怪的 bug.
问题要是装了 gcc, 那么空间占用也就不小了.
ReysC
2022-04-21 11:58:00 +08:00
alpine 和 debian 打包差别只有几百 MB 空间
反而带来了一个完全不熟悉的环境,并且这个环境给生产用,你会非常遇到一些非常奇怪的点。
Buges
2022-04-21 14:15:10 +08:00
千万别 alpine ,很多包没有 wheel ,需要本机编译,速度慢、占用多,缺了各种工具链、库、头文件还要踩坑。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/848290

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX