Skip to content

fix(devcontainer): add missing ubuntu user to container image#783

Merged
eknabevcc merged 1 commit into
esmini:devfrom
jdsika:fix/devcontainer-ubuntu-user
Mar 31, 2026
Merged

fix(devcontainer): add missing ubuntu user to container image#783
eknabevcc merged 1 commit into
esmini:devfrom
jdsika:fix/devcontainer-ubuntu-user

Conversation

@jdsika

@jdsika jdsika commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Problem

The current devcontainer.json specifies "remoteUser": "ubuntu" but the base image ghcr.io/bounverif/esmini:latest-devel (AlmaLinux 8.10) does not contain an ubuntu user. This causes VS Code Dev Containers to fail immediately with:

Error: unable to find user ubuntu: no matching entries in passwd file

This affects all users trying to open the project in a Dev Container (Docker, Podman, etc).

Fix

  • Add a .devcontainer/Dockerfile that extends the base image and creates the ubuntu user (UID/GID 1000)
  • Update devcontainer.json to use build.dockerfile instead of the direct image reference

This preserves the original intent of remoteUser: ubuntu (non-root development) without requiring changes to the upstream container image.

Changes

File Change
.devcontainer/Dockerfile New - extends base image, adds ubuntu user
.devcontainer/devcontainer.json image replaced with build.dockerfile (3 lines)

Tested

Verified end-to-end with Podman 5.8.1 on Windows (WSL2):

  • devcontainer read-configuration - OK
  • devcontainer up - OK
  • Container runs as ubuntu user with workspace mounted at /workspaces/esmini - OK

@eknabevcc

Copy link
Copy Markdown
Collaborator

This is outside my comfort zone, but it looks like a good find and fix!
Please check minor comment regarding the add user command.

jdsika added a commit to jdsika/esmini that referenced this pull request Mar 31, 2026
The base image (ghcr.io/bounverif/esmini:latest-devel, AlmaLinux 8.10)
does not contain an 'ubuntu' user, causing Dev Containers to fail with:
  Error: unable to find user ubuntu: no matching entries in passwd file

Add a Dockerfile that extends the base image and creates the ubuntu user
(UID/GID 1000) with getent guards for idempotency. Update devcontainer.json
to use build.dockerfile instead of direct image reference.

Supersedes: esmini#783, esmini#785
Signed-off-by: jdsika <carlo.van-driesten@bmw.de>
The base image (ghcr.io/bounverif/esmini:latest-devel, AlmaLinux 8.10)
does not contain an 'ubuntu' user, causing Dev Containers to fail with:
  Error: unable to find user ubuntu: no matching entries in passwd file

Add a Dockerfile that extends the base image and creates the ubuntu user
(UID/GID 1000) with getent guards for idempotency. Update devcontainer.json
to use build.dockerfile instead of direct image reference.

Supersedes: esmini#783, esmini#785
Signed-off-by: jdsika <carlo.van-driesten@bmw.de>
@jdsika jdsika force-pushed the fix/devcontainer-ubuntu-user branch from b6907a7 to c7bf9ed Compare March 31, 2026 10:40
jdsika added a commit to jdsika/esmini that referenced this pull request Mar 31, 2026
The base image (ghcr.io/bounverif/esmini:latest-devel, AlmaLinux 8.10)
does not contain an 'ubuntu' user, causing Dev Containers to fail with:
  Error: unable to find user ubuntu: no matching entries in passwd file

Add a Dockerfile that extends the base image and creates the ubuntu user
(UID/GID 1000) with getent guards for idempotency. Update devcontainer.json
to use build.dockerfile instead of direct image reference.

Supersedes: esmini#783, esmini#785
Signed-off-by: jdsika <carlo.van-driesten@bmw.de>
@jdsika

jdsika commented Mar 31, 2026

Copy link
Copy Markdown
Contributor Author

Force-pushed this branch with the improved commit c7bf9ed3 that incorporates the getent guard from #785 for idempotent UID/GID handling. Switches devcontainer.json to build.dockerfile. Supersedes #785.

@eknabevcc the Dockerfile now uses getent guards as you suggested — safe if UID/GID 1000 is already taken.

@eknabevcc

Copy link
Copy Markdown
Collaborator

Looks solid, thanks for the fix and nicely structured PR!

@eknabevcc eknabevcc merged commit 383b1e9 into esmini:dev Mar 31, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants