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:

  • cannot open RPM, skipping in Dockerfile
  • Docker [error response]: Failed to choose a UCP node. UCP node does not exist.
  • How to run Express and Mongo using docker-compose
  • AWS Elastic Beanstalk Docker PHP application
  • Laravel MySQL Error ONLY on Scheduled Tasks (via cron)
  • docker pull manifest unknown blob errors
  • 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

  • Configuring Kafka to accept clients both from inside and outside docker
  • proxy'ing between docker containers
  • Docker - few containers
  • Why am I unable to access my node.js app within a docker container?
  • How to change docker ip address on centos 7?
  • How can I change the default assigned ip address for docker containers?
  • 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.