Ruby-Starter-Kits/Docker-Rails-Generator

Permission defined error caused by yarn cache clean --all

mattruzicka opened this issue · 1 comments

I'm getting the following when trying to create a build image with 'production' as the target.

docker build -t my_app --target production .

#22 19.09 yarn cache v1.22.10
#22 19.11 error An unexpected error occurred: "EACCES: permission denied, rmdir '/usr/src/yarn'".
#22 19.11 info If you think this is a bug, please open a bug report with the information provided in "/usr/src/app/yarn-error.log".
#22 19.11 info Visit https://yarnpkg.com/en/docs/cli/cache for documentation about this command.
------
executor failed running [/bin/sh -c yarn install --frozen-lockfile --check-files       && yarn cache clean --all]: exit code: 1

The image builds as expected when I remove this line:

&& yarn cache clean --all

Thank you @mattruzicka for reporting this :)