0

When running this command, I get a total build time of (on average) 70s.

docker run -v $(pwd)/app:/srv -w /srv --rm -it node:16 npm run build

When running the command directly, locally (npm run build) it takes on average 14s.

Is there a reason the command takes so much longer to run in a docker container?

System details:
macOS 12.5
docker version 20.10.17, build 100c701
Resources given to docker: 
CPUs - 8
Memory - 8gb
Swap - 2gb
rbhalla
  • 869
  • 8
  • 32
  • Is it the same problem as [Docker in MacOs is very slow](https://stackoverflow.com/questions/55951014/docker-in-macos-is-very-slow)? If you remove the `docker run -v` option and `RUN npm build` in a custom Dockerfile, is it faster? – David Maze Sep 14 '22 at 00:39
  • @DavidMaze, ah yes it does look like that! I'll close this – rbhalla Sep 14 '22 at 20:44

0 Answers0