Search code examples
dockerubuntucontainersminikubedocker-build

Docker build hangs immediatly (with minikube and ubuntu, with not many files in the directory)


Upon a fresh start of my ubuntu (on a virtualbox vm), I can build my images normally. Then very inconstantly, it can be the next time I try to build, or the 10th time, it will hang forever after running the command docker build .

Dockerfiles are in directories with 5~10 other files (which eliminates the issue with massive file amount slowing down docker while trying to locate the Dockerfile, as seen on other posts)

If I try to build for a new, very simple, Dockerfile (to eliminate any syntax error), it will also hang whenever it hangs with my project's Dockerfiles.

Beside, I am running minikube --driver=none and my images are used for deployments in kubernetes. (with none driver it's not required to run eval $(minikube docker-env) )

The only reliable fix is to stop the vm on which my ubuntu is running, start it again, and it will consistently allow me to build my images at least one time, then the issue comes back inconsistently.

This fix is quite inconvenient as I need to stop everything I am doing and it takes a bit of time.

I have tried to run docker system prune and to delete all the images already built.

What log could I check to find an issue going on when the build hangs ? Any idea of the origin of the issue ?

Thanks a lot !


Solution

  • Ok this bug was viscous.

    Sometimes when I need to check how my nginx server behave in one of the containers, I open the VM's graphical interface and pop firefox to have a look. I only figured today that firefox prompt a pop-up after a while, asking for the admin password in order to access the keychain. And turns out docker do not build anything until this pop-up is open. Closing it or filling the password fixed my issue...