-
Notifications
You must be signed in to change notification settings - Fork 26
Upgrade Whitehall's base image to use Yarn 4 [WHIT-1954] #908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Following the deprecation of Yarn 1.xx and 2.xx, we have upgraded Whitehall's base image to use Yarn v4. Consequently, flags like `--production` `--frozen-lockfile` have been removed. Associated PR: alphagov/govuk-docker#908 Flags: https://yarnpkg.com/cli/install
Following the deprecation of Yarn 1.xx and 2.xx, we have upgraded Whitehall's base image to use Yarn v4. Consequently, flags like `--production` `--frozen-lockfile` have been removed. Associated PR: alphagov/govuk-docker#908 Flags: https://yarnpkg.com/cli/install JIRA: https://gov-uk.atlassian.net/browse/WHIT-1954
Following the deprecation of Yarn 1.xx and 2.xx, we have upgraded Whitehall's base image to use Yarn v4. Consequently, flags like `--production` `--frozen-lockfile` have been removed. Associated PR: alphagov/govuk-docker#908 Flags: https://yarnpkg.com/cli/install JIRA: https://gov-uk.atlassian.net/browse/WHIT-1954
Following the deprecation of Yarn 1.xx and 2.xx, we have upgraded Whitehall's base image to use Yarn v4. Consequently, flags like `--production` `--frozen-lockfile` have been removed. Associated PR: alphagov/govuk-docker#908 Flags: https://yarnpkg.com/cli/install JIRA: https://gov-uk.atlassian.net/browse/WHIT-1954
Following the deprecation of Yarn 1.xx and 2.xx, we have upgraded Whitehall's base image to use Yarn v4. Consequently, flags like `--production` `--frozen-lockfile` have been removed. Associated PR: alphagov/govuk-docker#908 Flags: https://yarnpkg.com/cli/install JIRA: https://gov-uk.atlassian.net/browse/WHIT-1954
Following the deprecation of Yarn 1.xx and 2.xx, we have upgraded Whitehall's base image to use Yarn v4. Consequently, flags like `--production` `--frozen-lockfile` have been removed. Associated PR: alphagov/govuk-docker#908 Flags: https://yarnpkg.com/cli/install JIRA: https://gov-uk.atlassian.net/browse/WHIT-1954
Following the deprecation of Yarn 1.xx and 2.xx, we have upgraded Whitehall's base image to use Yarn v4. Consequently, flags like `--production` `--frozen-lockfile` have been removed. Associated PR: alphagov/govuk-docker#908 Flags: https://yarnpkg.com/cli/install JIRA: https://gov-uk.atlassian.net/browse/WHIT-1954
Following the deprecation of Yarn 1.xx and 2.xx, we have upgraded Whitehall's base image to use Yarn v4. Consequently, flags like `--production` `--frozen-lockfile` have been removed. Associated PR: alphagov/govuk-docker#908 Flags: https://yarnpkg.com/cli/install JIRA: https://gov-uk.atlassian.net/browse/WHIT-1954
Following the deprecation of Yarn 1.xx and 2.xx, we have upgraded Whitehall's base image to use Yarn v4. Consequently, flags like `--production` `--frozen-lockfile` have been removed. Associated PR: alphagov/govuk-docker#908 Flags: https://yarnpkg.com/cli/install JIRA: https://gov-uk.atlassian.net/browse/WHIT-1954
matthillco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've successfully built this docker image against the other PR in Whitehall. No errors and the app spins up fine.
I'm happy to approve this, nice work.
ChrisBAshton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment below 🙏
projects/whitehall/Dockerfile
Outdated
| RUN apt-get update -qq && apt-get install -y yarn nodejs | ||
| RUN yarn config set cache-folder /root/.yarn/ | ||
| RUN apt-get update -qq && apt-get install -y nodejs | ||
| RUN corepack enable && yarn set version 4.10.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally try to avoid pinning to patch versions - I think I'd replace with this:
| RUN corepack enable && yarn set version 4.10.3 | |
| RUN corepack enable && yarn set version 4.x |
...or is this because it has to match the exact version specified in package.json?
(If they need to be in sync, I'd add an inline comment to that effect, in this Dockerfile ^
Or I wonder if there's something dynamic we can do... something like this (thanks ChatGPT!)...?
# Enable corepack, fetch Yarn version from Whitehall package.json, and install that exact version
RUN corepack enable && \
YARN_VERSION=$(curl -s https://raw.githubusercontent.com/alphagov/whitehall/main/package.json \
| jq -r '.packageManager' \
| sed -E 's/^yarn@//') && \
yarn set version "$YARN_VERSION"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting as 4.x works and will pull the latest stable version of v4. Missed that from the docs earlier. Thanks @ChrisBAshton
The previous image uses an outdated version of Yarn (1.22.22). This commit has now upgraded the package to the latest stable version (4.10.3). We have also updated the cache folder config to follow the new method. See: - https://yarnpkg.com/cli/config/set - https://yarnpkg.com/configuration/yarnrc#cacheFolder
120d726 to
4c9f0e2
Compare
Following the deprecation of Yarn 1.xx and 2.xx, we have upgraded Whitehall's base image to use Yarn v4. Consequently, flags like `--production` `--frozen-lockfile` have been removed. Associated PR: alphagov/govuk-docker#908 Flags: https://yarnpkg.com/cli/install JIRA: https://gov-uk.atlassian.net/browse/WHIT-1954
|
Converted to draft. We've decided to hold off until there's support more widely - see issue on Platform Engineering board: alphagov/govuk-infrastructure#3068 |
The previous image uses an outdated version of Yarn (1.22.22). This commit has now upgraded the package to the latest stable version (4.10.3). We have also updated the cache folder config to follow the new method. See:
JIRA: https://gov-uk.atlassian.net/browse/WHIT-1954