79685135

Date: 2025-06-30 18:05:00
Score: 1.5
Natty:
Report link

Docker build / buildkit does not use volumes even though you define them in the compose. Volumes are for running containers only.

The entire point of the build context is that the build is repeatable and consistent and volumes during build would break that idea.

If you are trying to optimize your npm build times/sizes You could look at adding additional contexts https://docs.docker.com/reference/cli/docker/buildx/build/#build-context

Also make sure your build has network access for npm i.e add

docker build --progress=plain --network host .

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: wozza xing