Search code examples
rubydockervagrantdpkgalpine-linux

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! ). 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. Problem is that the installation of vagrant.deb package isn't working correctly. I installed the alpine dpkg package, but get these errors:

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


Solution

  • In comments below the question we found out, that it is indeed possible to install the vagrant.deb using dpkg on Alpine Linux. 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 =).

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

    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. 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.

    If you want a minimal container then don't put a distribution into a container, put a process into a container!