Building docker image extremely slow on some steps inside minikube

I’m in the process of debugging this issue, but perhaps someone has shared the experience.

I evaluated the docker env inside minikube so it can use local images (ImageNeverPull). Then run docker build -t phoenix-app .

(the phoenix app is nothing more then a hello world)

At this point the container starts building but seems to slow down to extreme lengths on certain steps; e.g. one of these steps is RUN mix deps.get (it finishes after 15 minutes or so)

same for RUN mix compile and RUN mix local.hex --force && mix local.rebar --force

At inspection (minikube ssh && docker stats <image_id>) I see 100% CPU usage and nearly non existent network I/O, eventually the image build finishes, but it takes an incredible long time, while building the same image on my local machine (outside of minikube) is blazing fast. I also monitored resource usage of the kubernetes stack, but its far below the CPU, MEM and disk boundries available.

08

Update: memory consumption seems quite large the longer the process takes;

The virtual machine that powers your minikube, what share of your CPU does it get? What hypervisor is used or is the VM even started in software mode?

Thanks for the reply, I have tried hyperkit, vmware and virtualbox, all have the same issue so it seems there’s a different angle somewhere. I’ve setup 4 cores (have 8) 8 GB ram and 40gb of SSD.

It’s still running (from when I posted, and now hangs on ===> Compiling ranch (part of RUN mix deps.compile) with the same 100% cpu load.