Docker build stuck

Did you try to run htop in a second connection to see memory usage? Did you try with a 1GB RAM VPS?