简体   繁体   English

Debian Packagemanager在构建docker映像时不会在alpine-linux上安装vagrant.deb软件包

[英]Debian Packagemanager won't install vagrant.deb package on alpine-linux, while building docker image

I am new to docker but managed to build myself some dev-environment images ( which is awesome! ). 我是Docker的新手,但设法为自己构建了一些开发环境映像(真棒!)。 But i wasn't quite satisfied with the filesize of the resulting image, so i tried to migrate the image from node-argon image ( based on debian-wheezy ) to alpine image. 但是我对生成的图像的文件大小不太满意,因此我尝试将图像从节点氩气图像(基于debian-wheezy)迁移到高山图像。 Problem is that the installation of vagrant.deb package isn't working correctly. 问题是vagrant.deb软件包的安装无法正常工作。 I installed the alpine dpkg package, but get these errors: 我安装了高山dpkg软件包,但出现以下错误:

dpkg: error: failed to open package info file '/var/lib/dpkg/status' for reading: No such file or directory

I found some threats about this topic, but were not related to alpine installation and wouldn't fix my issues. 我发现了与此主题有关的一些威胁,但与高山安装无关,因此无法解决我的问题。 Relevant docker lines are: 相关泊坞窗行是:

FROM gliderlabs/alpine:3.3
RUN apk add --update dpkg
ENV VAGRANT_VERSION 1.8.1
ADD https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.deb .
RUN dpkg -i vagrant_${VAGRANT_VERSION}_x86_64.deb
RUN rm vagrant_*.deb

Someone else got this working - my guess was that there maybe some build/install dependencies missing, but couldn't get it any further. 有人使这个工作正常-我的猜测是可能缺少一些构建/安装依赖项,但无法继续进行下去。 Any advice would be much appriciated. 任何建议都会被采纳。

All the best, florian 祝一切顺利,花店

In comments below the question we found out, that it is indeed possible to install the vagrant.deb using dpkg on Alpine Linux. 在发现问题的下方注释中,确实可以在Alpine Linux上使用dpkg安装vagrant.deb。 However, it was really hackish(!) and at the end the advantage in size of the Alpine Linux didn't matter since the resulting image had a size of 2.5G =). 但是,这确实有点骇人听闻(!),最终Alpine Linux的大小优势并不重要,因为生成的映像大小为2.5G =)。

That's why my answer is (I said that before): Make your life easy and use a Debian or Ubuntu image if you want to install deb packages :) 这就是为什么我的答案是(我之前说过):如果您想安装deb软件包,请轻松生活并使用Debian或Ubuntu映像:)

For all potential Alpine-container users, please think twice if you really need a base image that is a couple of MB smaller than common GNU/Linux base images. 对于所有潜在的Alpine容器用户,如果您确实需要一个比通用GNU / Linux基本映像小几个MB的基本映像,请三思而后行。 You'll pay the price for that few MBs with having a poor shell environment (Welcome to the 80s!) and a significantly smaller amount of available packages. 您只需为这几MB的外壳环境差的价格(欢迎使用80年代!)和少量可用的软件包付费。

If you want a minimal container then don't put a distribution into a container, put a process into a container! 如果您想要一个最小的容器,那么不要将分发放入容器中,而是将一个过程放入容器中!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM