diff --git a/Dockerfile b/Dockerfile index ab6dd3b..f6773a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN set -ex; \ # add a non-root user to run our code as RUN adduser --disabled-password --gecos "" appuser -RUN mkdir -p /home/appuser/.cache/node/corepack/v1 +RUN mkdir -p /home/appuser/.cache/node/corepack # install our test runner to /opt WORKDIR /opt/test-runner @@ -22,7 +22,9 @@ COPY . . # Build the test runner RUN set -ex; \ corepack enable; \ + # install corepack globally with the last known good version of yarn corepack pack -o ./corepack.tgz; \ + COREPACK_ENABLE_NETWORK=0 corepack install -g "./corepack.tgz"; \ # install all the development modules (used for building) yarn cache clean; \ yarn install; \ @@ -36,5 +38,8 @@ RUN set -ex; \ # # TODO: yarn workspaces focus --production; +ENV COREPACK_ENABLE_NETWORK=0 +ENV YARN_ENABLE_OFFLINE_MODE=1 + USER appuser ENTRYPOINT [ "/opt/test-runner/bin/run.sh" ] diff --git a/bin/run.sh b/bin/run.sh index 3c19bdd..2ebb746 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -172,8 +172,6 @@ result_file="${OUTPUT}results.json" # Check yarn if test -f "$ROOT/corepack.tgz"; then YARN_ENABLE_OFFLINE_MODE=1 yarn -v - COREPACK_ENABLE_NETWORK=0 corepack enable - YARN_ENABLE_OFFLINE_MODE=1 yarn -v # COREPACK_ENABLE_NETWORK=0 corepack install -g "$ROOT/corepack.tgz" else