Docker build freezes installing packages from apt

I have a dockerfile which needs installing some 720mb worth of packages from apt.

run DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip python-dev\
    supervisor mercurial subversion buildbot buildbot-slave subversion doxygen\
    cmake cloc build-essential valgrind cccc scons g++ cppcheck qt4-dev-tools\
    wget lcov graphviz

The build runs up to almost half of the packages requested, then it just hangs idle there.

  • Installing and using Gradle in a docker image/container
  • Debian httpredir mirror system unreliable/unusable in Docker?
  • Docker Image installing php modules
  • Docker automated build results in Unexpected failure
  • Linux “Perf” tool cannot run inside docker images?
  • Golang Mac OSX build for Docker machine
  • Is there a way to know for sure if the process has halted or if it’s just idle waiting for the network or something along those lines?

  • Docker: adding a file from a parent directory
  • How can I use a docker container with a self signed certificate on osx?
  • Failed to communicate a dockerized process with elastic search with “None of the configured nodes are available”
  • Python multiprocessing not working in docker container
  • Why do containers fail to fetch URIs in DC/OS?
  • Mounting ISO images with powershell inside windowsservercore fails
  • 2 Solutions collect form web for “Docker build freezes installing packages from apt”

    You can check which process is running using e.g. ps faux | less. Scroll down to find the lxc-start process corresponding to your container, and see what is running under it (the f flag triggers a forest display which should show in a pretty obvious way which processes belong to the container).

    Then, you can use strace -fp <pid> to attach to the last running process in that container and see what it is doing.

    Last but not least, you can try to break down the command in 2 or 3 phases. In the (unlikely) case where the problem would come from a package prompting you for input (which shouldn’t happen since you specified the noninteractive front-end, but who knows) that will help to single it out.

    Most of the time it’s a network issue. Do you use a proxy on your host?

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