在 Alpine docker 中安装软件包 [英] Install packages in Alpine docker

查看:54
本文介绍了在 Alpine docker 中安装软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  1. software-properties-common
  2. openjdk-8-jdk
  3. python3
  4. nltk
  5. 烧瓶

解决方案

aptapt-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:

  1. software-properties-common
  2. openjdk-8-jdk
  3. python3
  4. nltk
  5. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆