nitrictech / nitric

Nitric is a multi-language framework for cloud applications with infrastructure from code.
https://nitric.io
Apache License 2.0
861 stars 43 forks source link

Docker volume yarn cache blocks npm being used with Typescript builds #588

Closed HomelessDinosaur closed 4 months ago

HomelessDinosaur commented 4 months ago

Adding this to help others who run into the same issue.

When using npm install before building your images, you might encounter the following issue:

ERROR: failed to solve: process "/bin/sh -c set -ex &&     yarn install --production --prefer-offline --frozen-lockfile --cache-folder /tmp/.yarn_cache" did not complete successfully: exit code: 1

You can solve this by pruning the volume storing the local cache state called buildx_buildkit_nitric0_state or similar. This can be done using:

docker volume ls (to find the volume to remove)
docker volume rm buildx_buildkit_nitric0_state