fix(devcontainer): drop stale vscode remoteUser - #14441
Open
NichSchlagen wants to merge 1 commit into
Open
Conversation
The `vscode` user was created by the `ghcr.io/devcontainers/features/common-utils:2` feature, which was removed in cc4337c (terrapkg#12805). `remoteUser` and the `usermod -a -G mock vscode` onCreateCommand were left behind, so the container now starts but fails as soon as the Dev Containers CLI tries to open a shell: unable to find user vscode: no matching entries in passwd file ghcr.io/terrapkg/builder has no `vscode` user, so run as root instead. This matches how CI already builds packages with the same image, where mock works fine as root.
Member
|
do we want to allow this to run as root or not, @Owen-sz thoughts? |
Member
|
I don't see an issue? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening the repo in the dev container fails immediately:
The container itself starts fine; it breaks as soon as the Dev Containers CLI tries to open a shell as
remoteUser.Cause
The
vscodeuser came from theghcr.io/devcontainers/features/common-utils:2feature. That feature was removed in cc4337c (#12805), butremoteUserand theusermod -a -G mock vscodeonCreateCommand were left behind.ghcr.io/terrapkg/builderhas novscodeuser of its own:So the dev container has been broken for everyone since that commit.
Fix
Drop
remoteUserand the onCreateCommand and run as root, which also makes theusermodinto themockgroup unnecessary. This matches how CI already builds packages with the very same image — GitHub Actions containers run as root, and mock works fine there (see.github/workflows/json-build.yml).Re-adding the
common-utilsfeature would be the alternative if an unprivileged user is wanted, but that seems to go against the intent of #12805.Verification
With this change the container comes up, and a real package build inside it completes as root: