在 Alpine docker 中安装软件包 [英] Install packages in 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 中安装软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!