在高山容器上贴身 [英] Getting apt-get on an alpine container

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

问题描述

我必须在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 专为简化和速度而设计,应该很少习惯。

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.

对于一个很好的教程,我热烈推荐 apk 简介页在Alpine Wiki网站上:
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.

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

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