Fix Dev Container build failure from expired Yarn GPG key#4836
Fix Dev Container build failure from expired Yarn GPG key#4836
Conversation
- Add RUN command to update Yarn GPG key before apt operations - Update CHANGELOG.md with bug fix entry - Resolves issue #4832 Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
|
Fyi @marrobi this errors for me |
|
@tamirkamara if this isn't fixed by Monday , suggest we merge this. |
|
this variant worked for me @marrobi see devcontainers/images#1752 |
|
@copilot see #4836 (comment) anddhttps://github.com//pull/4836#issuecomment-3824982124 check the devcontainer builds |
- Use /usr/share/keyrings path instead of /etc/apt/keyrings - Add --batch --yes flags to gpg for non-interactive operation - Use -o flag for direct output instead of tee - Based on verified working solution from devcontainers/images#1752 Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Fixed in commit 8371462. Updated to use the working solution with
... Thanks for the working solution! Implemented in commit 8371462.
Updated to use the verified working solution in commit 8371462. The fix now uses |
|
/test 8371462 This might give us a cached dev container build that works. |
|
🤖 pr-bot 🤖 🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/21530235074 (with refid (in response to this comment from @marrobi) |
Unit Test Results0 tests 0 ✅ 0s ⏱️ Results for commit 9a7f800. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a Dev Container build failure caused by Yarn's expired GPG key (NO_PUBKEY 62D54FD4003F6525) by updating to the new signing key released on 2026-01-28.
Changes:
- Added RUN command in
.devcontainer/Dockerfileto fetch and install the updated Yarn GPG key before apt operations - Updated CHANGELOG.md with bug fix entry under the BUG FIXES section
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.devcontainer/Dockerfile |
Added GPG key update command after SHELL directive to fetch new Yarn signing key and install to /usr/share/keyrings/yarn-archive-keyring.gpg |
CHANGELOG.md |
Added bug fix entry documenting the Yarn GPG key fix with issue reference #4832 |
| RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg \ | ||
| | gpg --batch --yes --dearmor -o /usr/share/keyrings/yarn-archive-keyring.gpg |
There was a problem hiding this comment.
The GPG key update command lacks error handling. If the curl command fails (e.g., due to network issues or if the URL changes), the pipe will silently fail and the build will continue without updating the key, potentially leading to the same apt update failures this fix is meant to prevent.
Consider adding error handling by either:
- Running the curl command separately with explicit error checking
- Adding
set -ebehavior to ensure the RUN command fails on any error in the pipeline
This is especially important since this fix is critical for the build to succeed, and silent failures would be difficult to debug.
| RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg \ | |
| | gpg --batch --yes --dearmor -o /usr/share/keyrings/yarn-archive-keyring.gpg | |
| RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg -o /tmp/yarn-pubkey.gpg \ | |
| && gpg --batch --yes --dearmor -o /usr/share/keyrings/yarn-archive-keyring.gpg /tmp/yarn-pubkey.gpg |
What is being addressed
Dev Container builds fail during
apt updatewithNO_PUBKEY 62D54FD4003F6525. Yarn's GPG key expired and was replaced with a new signing key on 2026-01-28.How is this addressed
.devcontainer/Dockerfileto fetch updated Yarn GPG key before apt operations using the verified working solution:RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg \ | gpg --batch --yes --dearmor -o /usr/share/keyrings/yarn-archive-keyring.gpg/usr/share/keyrings/yarn-archive-keyring.gpg(correct keyring location for the base image)--batch --yesflags to gpg command for non-interactive operation-oflag for direct output instead ofteeOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.