Docker Community Forums

Share and learn in the Docker community.

Debugging why docker-compose takes a long time to get to step 1

I have a docker-compose file that starts 5 different containers however, I only have this problem with 1 container.

When I execute:

docker-compose build my_container

it will display:

Building my_container

After this it will wait for around 5-10 minutes before proceeding with the build process (Step 1, 2, 3, etc…). This wait will occur even if I make no changes to the container (i.e. it can load the entire container from cache)

I am running this inside a VM (my dev server - Ubuntu 18.04). When I build this container on my production server is DOES NOT wait and proceeds as fast as I expect. This leads me to believe it has something to do with my local configuration on my dev server but I am at a loss as to how I can go about finding what is causing the hangup.

I’ve tried running strace which shows that it hangs at the following step:

wait4(14640, Building my_container

Running sudo ps-a shows:

14640 pts/0    00:01:16 docker-compose

Is there a way I can better understand what is causing this hang up?