Unable to install packages using Docker on Mac

This morning I’ve started playing with Docker, so installed boot2docker on my Mac.

All seemed to be going well, following the Working with Docker Images documentation until I tried to create a Dockerfile to install the ruby gems.

  • NFS Volumes in Docker/Docker-Compose
  • “Docker-compose up” does not pull images everytime , it recreates a pulled image
  • Can I mount host directory contents to container directory?
  • Docker starting container throws cannot assign requested address error
  • Customize boot2docker.iso to use wireless devices on containers (Docker-toolbox)
  • boot2docker malformed HTTP status code “/v1.15/containers/json”
  • I spent a long time banging my head against the wall as to why it couldn’t connect to install the gems… then I eventually worked it out, so adding this here in case anyone else has this problem in future, as there wasn’t anything on Google about it.

  • golang:sshfs -o reconnect fails when used inside docker container with “reading directory .: Input/output error”
  • Define Docker container volume bindings in a configuration file?
  • How to deploy using capistrano without current release symlink?
  • Making an API call from dockerized web page to back-end server ends up with net::ERR_CONNECTION_REFUSED
  • Why am I getting a *much* worse performance with Docker Stack than Docker Compose?
  • Certificate exceptions when running Scala SBT on Docker Alpine Linux container
  • One Solution collect form web for “Unable to install packages using Docker on Mac”

    Turns out that, because my internet bombed out during the apt-get update command, it didn’t complete the update, however running it again, docker was using the cached (incomplete) data, and so if didn’t work.

    The fix… Run the docker build without the cache using the command…

    docker build -no-cache --tag="<vendor>/<build>:<tag>" .
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.