fix: image failures for non-root uses of yarn
and pnpm
#391
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The lockfile generation tool
yarn
fails when used in thephylum-ci
Docker image as a non-root user. An example of the failure can be seen from the output of the "smoke test," which is usingscripts/docker_tests.sh
to ensure basic functionality:The same behavior happens for
pnpm
. These are the tools installed bycorepack
, which changed recently to "Bump Known Good Release when downloading new version" (nodejs/corepack#364). Part of that change was to make use of theCOREPACK_DEFAULT_TO_LATEST
environment variable to not update the last known good version, but setting that to0
does not appear to prevent all writes (or creating a file handle with write permission) to thelastKnownGood.json
file.This fix simply modifies the file permissions for
lastKnownGood.json
so that non-root users can read and write to it. This approach may seem specific to a file that may change name or location in the future, but the alternative method of adding${COREPACK_HOME}
to the list of directories that get updated with achmod -vR 777
was deemed to be too blunt and therefore less desirable.