-
|
I'm trying to upgrade from the node alpine image to the dhi version of the image, and I get an error when starting the docker container. We have the packageManager defined in our package.json for consistent reproducible builds, and I'm having trouble getting the right version of yarn installed. ENV YARN_VERSION=4.12.0
# ...
RUN corepack enable
RUN corepack install
CMD yarn --immutable && yarn nx dev $NX_APPAnd I get the following error: Usage Error: Unrecognized or legacy configuration settings found: disableSelfUpdateCheck - run "yarn config" to see the list of settings supported in Yarn (in <environment>)The The Socket Firewall version doesn't even get that far -- the corepack commands run successfully, but the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hello! Thanks for asking this question. I did some poking around and was able to reproduce your issue and also figure out a working fix for you. The DHI node images set FROM dhi.io/node:20-alpine3.23-dev AS build-stage
...
# Unset once, chain multiple yarn commands
RUN unset YARN_DISABLE_SELF_UPDATE_CHECK && \
yarn install && \
yarn add some-package && \
yarn --versionAnd here is a one-shot script so you can easily see this in action: mkdir dhi-yarn-test && cd dhi-yarn-test
cat > Dockerfile << 'EOF'
FROM dhi.io/node:20-alpine3.23-dev AS build-stage
WORKDIR /usr/src/app
RUN corepack enable
COPY package*.json ./
RUN unset YARN_DISABLE_SELF_UPDATE_CHECK && \
yarn install && \
yarn --version
EOF
cat > package.json << 'EOF'
{
"name": "dhi-yarn-test",
"version": "1.0.0",
"packageManager": "yarn@4.12.0",
"dependencies": {}
}
EOF
docker build -t dhi-yarn-test .
docker run --rm dhi-yarn-test sh -c "unset YARN_DISABLE_SELF_UPDATE_CHECK && yarn --version"The output should be: 4.12.0Let me know if you have any issues with the above instructions. Cheers, |
Beta Was this translation helpful? Give feedback.
Hello! Thanks for asking this question. I did some poking around and was able to reproduce your issue and also figure out a working fix for you.
The DHI node images set
YARN_DISABLE_SELF_UPDATE_CHECK=trueas you obvserved, which is a Yarn v1 config that conflicts with Yarn v4. Unset this variable before running yarn commands and your issue should be resolved:And here is a one-shot script so you can easily see this in action: