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:

  • How to overwrite default command when running docker image
  • Development environment and local sites URLs best practices
  • Why is the loop-lvm device storage not suitable for production?
  • Docker image just contain software without OS
  • Check for network error in cf ic login in Bluemix
  • Fig (Docker): how to specify which services to run depending on the environment
  • 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

  • What is meant by shared kernel in Docker?
  • Kubernetes Volume Mount with Replication Controllers
  • How restart a stopped docker container
  • Why the “See It Work” section of the Docker https-portal gives me a “port 443: Connection refused” error?
  • Why would I want to to use VOLUME inside a Dockerfile?
  • How do I read data in dockerized kafka from a spark streaming application?
  • 2 Solutions collect form web for “Debian Packagemanager won't install vagrant.deb package on alpine-linux, while building docker image”

    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!

    I build a new image according to hek2mgl suggestions, using debian:7.
    Resulting image can be found at: https://hub.docker.com/r/floneu/hashicorp/

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.