Skip to content

Add remoteUser to .devcontainer to fix JetBrains IDE support (#728) - #729

Open
bedrich-schindler wants to merge 1 commit into
masterfrom
task/728
Open

Add remoteUser to .devcontainer to fix JetBrains IDE support (#728)#729
bedrich-schindler wants to merge 1 commit into
masterfrom
task/728

Conversation

@bedrich-schindler

Copy link
Copy Markdown
Contributor

Opening the project in WebStorm using the Dev Containers "Clone" mode failed during the IDE remote agent bootstrap with:

chgrp: invalid group: '1000:1000'

The chgrp call is issued by the JetBrains dev-container helper while it fixes the ownership of its remote agent files. With no user declared in devcontainer.json, WebStorm falls back to the Compose user: directive (${COMPOSE_UID}:${COMPOSE_GID}) and passes the literal 1000:1000 string to chgrp, which accepts only a group, never a uid:gid pair.

Declaring "remoteUser": "developer" makes WebStorm resolve the user via /etc/passwd inside the container instead. This is safe on all platforms: fixuid rewrites the developer entry at container start to match the uid:gid the container runs as, and devcontainer.json is not read outside the dev-container workflow (plain docker compose up, terminals, CI), so nothing else is affected.

Opening the project in WebStorm using the Dev Containers "Clone" mode
failed during the IDE remote agent bootstrap with:

chgrp: invalid group: '1000:1000'

The `chgrp` call is issued by the JetBrains dev-container helper while it
fixes the ownership of its remote agent files. With no user declared in
`devcontainer.json`, WebStorm falls back to the Compose `user:` directive
(`${COMPOSE_UID}:${COMPOSE_GID}`) and passes the literal `1000:1000`
string to `chgrp`, which accepts only a group, never a `uid:gid` pair.

Declaring `"remoteUser": "developer"` makes WebStorm resolve the user via
`/etc/passwd` inside the container instead. This is safe on all
platforms: `fixuid` rewrites the `developer` entry at container start to
match the uid:gid the container runs as, and `devcontainer.json` is not
read outside the dev-container workflow (plain `docker compose up`,
terminals, CI), so nothing else is affected.
"../docker-compose.yml"
],
"service": "devcontainer",
"remoteUser": "developer",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it and it works ✅. But I'm seeing a strange thing: no node_modules directory in the workspace, but running npm start and serving the docs after npm ci works. Does it have anything to do with the "Shallow repository" IDE notification?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JetBrains IDE fails to start Development Containers in Clone mode

3 participants