boy461205160
V2EX  ›  问与答

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

  •  
  •   boy461205160 · Apr 21, 2022 · 2653 views
    This topic created in 1662 days ago, the information mentioned may be changed or developed.
    7 replies  •  2022-04-21 14:15:10 +08:00
    echo1937
    echo1937
    Apr 21, 2022
    1
    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
    676529483
    Apr 21, 2022
    2
    以前看过 alphine 的 python 貌似慢一点,我以前为了节省磁盘也用 alpine 的版本,后来发现直接用官方的 slim 版一样,调试还方便
    yangyaofei
    yangyaofei
    Apr 21, 2022
    3
    看用不用某些 C 库吧, alpine 如果需要装东西(特别是 GCC)之类的,就不推荐作为构建了,不如 slim 来的好
    4BVL25L90W260T9U
    4BVL25L90W260T9U
    Apr 21, 2022
    4
    没事儿别用 alpine ,坑多而且慢,为了省一点硬盘空间不值当的。
    Symo
    Symo
    Apr 21, 2022
    5
    建议用 debian slim, alpine 没有 gcc
    musl 在 k8s 上会有一些奇怪的 bug.
    问题要是装了 gcc, 那么空间占用也就不小了.
    ReysC
    ReysC
    Apr 21, 2022
    6
    alpine 和 debian 打包差别只有几百 MB 空间
    反而带来了一个完全不熟悉的环境,并且这个环境给生产用,你会非常遇到一些非常奇怪的点。
    Buges
    Buges
    Apr 21, 2022 via Android
    7
    千万别 alpine ,很多包没有 wheel ,需要本机编译,速度慢、占用多,缺了各种工具链、库、头文件还要踩坑。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1641 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 12:39 · PVG 20:39 · LAX 04:39 · JFK 07:39
    ♥ Do have faith in what you're doing.