-
-
Notifications
You must be signed in to change notification settings - Fork 235
Closed
Description
Description
I currently have the following Dockerfile:
FROM node:18-bullseye
RUN corepack enable yarn
My production environment runs this image in readonly, this way:
docker run --rm -it --read-only --mount 'type=tmpfs,dst=/tmp' IMAGE_BUILT bash
The problem is we can't instruct corepack to not write cache folder leading to the following error running yarn:
root@5cd6509d006b:/# yarn --version
Internal Error: ENOENT: no such file or directory, mkdir '/root/.cache'
Error: ENOENT: no such file or directory, mkdir '/root/.cache'
My current workaround is to use /tmp (monkey patch, this folder is not the best from security perspective):
FROM node:18-bullseye
ENV COREPACK_HOME /tmp/corepack
RUN corepack enable yarn
I think, the good solution from a security perspective would be to have an option to instruct corepack not to write anything.
blephy, Myushu, Derkades, rafaellucio, adamdabbracci and 4 morerafaellucio
Metadata
Metadata
Assignees
Labels
No labels