Skip to content

Commit 5486b17

Browse files
committed
Try somewhere instead of tmp
1 parent 2018a1c commit 5486b17

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

Dockerfile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ RUN set -ex; \
1313
#
1414
# add a non-root user to run our code as
1515
adduser --disabled-password --gecos "" appuser; \
16-
mkdir /tmp/.cache/node/corepack/v1 -p; \
17-
chmod 555 /tmp/.cache/node/corepack/v1; \
18-
chown -R appuser /tmp/.cache/node;
16+
mkdir /somewhere/.cache/node/corepack/v1 -p; \
17+
chmod 555 /somewhere/.cache/node/corepack/v1; \
18+
chown -R appuser /somewhere/.cache/node;
1919

2020
# install our test runner to /opt
2121
WORKDIR /opt/test-runner
2222
COPY . .
2323

24-
ENV COREPACK_HOME=/tmp/.cache/node \
24+
ENV COREPACK_HOME=/somewhere/.cache/node \
25+
COREPACK_DEFAULT_TO_LATEST=0 \
2526
DEBUG=corepack;
2627

2728
RUN set -ex; \
@@ -35,8 +36,8 @@ RUN set -ex; \
3536
#
3637
# https://github.com/nodejs/corepack/issues/414#issuecomment-2096218732
3738
# https://github.com/nodejs/corepack/blob/bc13d40037d0b1bfd386e260ae741f55505b5c7c/sources/folderUtils.ts#L26-L31
38-
# chmod 444 /root/.cache/node/corepack/lastKnownGood.json; \
39-
# chmod 555 /root/.cache/node/corepack/corepack; \
39+
# chmod 444 /somewhere/.cache/node/corepack/lastKnownGood.json; \
40+
# chmod 555 /somewhere/.cache/node/corepack/corepack; \
4041
#
4142
# Build the test runner
4243
# RUN set -ex; \
@@ -50,9 +51,6 @@ RUN set -ex; \
5051
ENV COREPACK_ENABLE_NETWORK=0 \
5152
COREPACK_ENABLE_STRICT=0 \
5253
#
53-
# Disable lastKnownGood
54-
COREPACK_DEFAULT_TO_LATEST=0 \
55-
#
5654
# Mark this as a docker run so we don't try to execute things in /tmp
5755
TMP_MAY_BE_NON_EXEC=1;
5856

0 commit comments

Comments
 (0)