如何编写 Dockerfile 命令以在 alpine docker 镜像中安装以下内容:
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 添加 wgetAlpine 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:
解决方案
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 wgetAlpine 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 中安装软件包
发布评论