V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
boy461205160
V2EX  ›  问与答

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

  •  
  •   boy461205160 · 2022-04-21 10:00:09 +08:00 · 1139 次点击
    这是一个创建于 707 天前的主题,其中的信息可能已经有所发展或是发生改变。
    7 条回复    2022-04-21 14:15:10 +08:00
    echo1937
        1
    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
        2
    676529483  
       2022-04-21 10:45:49 +08:00
    以前看过 alphine 的 python 貌似慢一点,我以前为了节省磁盘也用 alpine 的版本,后来发现直接用官方的 slim 版一样,调试还方便
    yangyaofei
        3
    yangyaofei  
       2022-04-21 11:27:52 +08:00
    看用不用某些 C 库吧, alpine 如果需要装东西(特别是 GCC)之类的,就不推荐作为构建了,不如 slim 来的好
    ospider
        4
    ospider  
       2022-04-21 11:30:22 +08:00
    没事儿别用 alpine ,坑多而且慢,为了省一点硬盘空间不值当的。
    Symo
        5
    Symo  
       2022-04-21 11:36:26 +08:00
    建议用 debian slim, alpine 没有 gcc
    musl 在 k8s 上会有一些奇怪的 bug.
    问题要是装了 gcc, 那么空间占用也就不小了.
    ReysC
        6
    ReysC  
       2022-04-21 11:58:00 +08:00
    alpine 和 debian 打包差别只有几百 MB 空间
    反而带来了一个完全不熟悉的环境,并且这个环境给生产用,你会非常遇到一些非常奇怪的点。
    Buges
        7
    Buges  
       2022-04-21 14:15:10 +08:00 via Android
    千万别 alpine ,很多包没有 wheel ,需要本机编译,速度慢、占用多,缺了各种工具链、库、头文件还要踩坑。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1278 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 23:29 · PVG 07:29 · LAX 16:29 · JFK 19:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.