Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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?

like image 323
tutuca Avatar asked Jan 07 '14 19:01

tutuca


2 Answers

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.

like image 121
jpetazzo Avatar answered Nov 04 '22 23:11

jpetazzo


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

like image 26
Thomas Decaux Avatar answered Nov 04 '22 22:11

Thomas Decaux