如何编写 Dockerfile 命令以在 alpine docker 镜像中安装以下内容:
- 软件属性-通用
- openjdk-8-jdk
- python3
- nltk
- flask
最佳答案
Alpine 中 apt
或 apt-get
的等价物是 apk
一个典型的 Dockerfile 将包含,例如:
RUN apk add --no-cache wget
--no-cache
is the equivalent to:apk add wget && rm -rf /var/cache/apk/*
或者,在 --no-cache 选项可用之前:
RUN apk update && apk add wget
Alpine rm -rf/var/cache/apk/*
具有 Debian 等效的 rm -rf/var/lib/apt/lists/*
。
见 Alpine comparison with other distros了解更多详情。
关于linux - 在 Alpine docker 中安装软件包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48281323/