在 Alpine docker 中安装软件包

编程入门 行业动态 更新时间:2024-10-25 11:24:20
本文介绍了在 Alpine docker 中安装软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何编写 Dockerfile 命令以在 alpine docker 镜像中安装以下内容:

  • software-properties-common
  • openjdk-8-jdk
  • python3
  • nltk
  • 烧瓶
  • 解决方案

    apt 或 apt-get 在 Alpine 中的等价物是 apk

    一个典型的 Dockerfile 将包含,例如:

    RUN apk add --no-cache wget

    --no-cache 相当于:apk 添加 wget &&rm -rf/var/cache/apk/*

    或者,在 --no-cache 选项可用之前:

    RUN apk update &&apk 添加 wget

    Alpine rm -rf/var/cache/apk/* 具有与 Debian 等效的 rm -rf/var/lib/apt/lists/*.

    有关详细信息,请参阅Alpine 与其他发行版的比较.

    How do I write Dockerfile commands to install the following in alpine docker image:

  • software-properties-common
  • openjdk-8-jdk
  • python3
  • nltk
  • Flask
  • 解决方案

    The equivalent of apt or apt-get in Alpine is apk

    A typical Dockerfile will contain, for example:

    RUN apk add --no-cache wget

    --no-cache is the equivalent to: apk add wget && rm -rf /var/cache/apk/*

    or, before the --no-cache option was available:

    RUN apk update && apk add wget

    Alpine rm -rf /var/cache/apk/* has the Debian equivalent rm -rf /var/lib/apt/lists/*.

    See the Alpine comparison with other distros for more details.

    更多推荐

    在 Alpine docker 中安装软件包

    本文发布于:2023-07-05 08:58:24,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1035466.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:软件包   Alpine   docker

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!