在高山容器上获取​​ apt-get [英] Getting apt-get on an alpine container

查看:34
本文介绍了在高山容器上获取​​ apt-get的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在我的 docker 容器上安装一些依赖项,我想使用 python:3.6-alpine 版本让它尽可能轻,但是 alpine 附带的 apk 包管理器给我带来了麻烦,所以我想获取 apt-get 包管理器.我试过了:

I have to install a few dependencies on my docker container, I want to use python:3.6-alpine version to have it as light as possible, but apk package manager which comes with alpine is giving me trouble so I would like to get the apt-get package manager. I tried:

apk add apt-get

它没有用.

我怎样才能把它放在容器上?

how can I get it on the container?

推荐答案

使用多个包系统通常是一个非常糟糕的主意,原因有很多.包裹很可能会发生碰撞和损坏,最终会比开始时更混乱.
有关更多详细信息,请参阅此优秀答案:使用多个包管理器是否存在陷阱?

Using multiple package systems is usually a very bad idea, for many reasons. Packages are likely to collide and break and you'll end up with much greater mess than you've started with.
See this excellent answer for more detail: Is there a pitfall of using multiple package managers?

更可行的方法是排除故障并解决您在使用 apk 时遇到的问题.apk 是为简单和快速而设计的,几乎不需要习惯.IMO,它真的是一个出色的包管理器.

A more feasible approach would be troubleshooting and resolving the issues you are having with apk. apk is designed for simplicity and speed, and should take very little getting used to. It is really an excellent package manager, IMO.

对于一个好的教程,我热烈推荐 Alpine Wiki 站点上的 apk 介绍页面:https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management

For a good tutorial, I warmly recommend the apk introduction page at the Alpine Wiki site: https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management

如果您决定不使用 apk,并且为了实验想要尝试使用 apt 代替,作为第一步,您将首先拥有从源代码构建 apt:https://github.com/Debian/apt.然后,如果它产生了一个功能性构建(不太可能,因为它可能与 musl libc 不兼容),你必须将它连接到一些存储库,但 Alpine 存储库仅适用于 apk,而不适用于apt.如你所见,这不是真的可行,也不是你想去的路线.

If you're determined not to use apk, and for the sake of experiment want try bringing up apt instead, as a first step, you'll have first to build apt from source: https://github.com/Debian/apt. Then, if it is produces a functional build (not likely since it's probably not compatible with musl libc), you'll have to wire it to some repositories, but Alpine repositories are only fit for apk, not apt. As you can see, this is not really feasible, and not the route you want to go to.

这篇关于在高山容器上获取​​ apt-get的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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