Skip to content

(.devcontainer.json): Development container opens project with incorrect permissions #19979

@CarlosDomingues

Description

@CarlosDomingues

Describe the bug

When opening the project with VS Code's Remote - Containers extension, my /workspaces directory has permissions to UID 1000. However, the image's default non-root user (superchain) has UID 1001.

As result, postCrateCommand will fail, files cannot be edited and scripts cannot be executed (without sudo).

I was able to workaround that by explicitly configuring the non-root user:

{
    "name": "Dev Container Definition - AWS CDK",
    "image": "jsii/superchain:1-buster-slim",
    "postCreateCommand": "yarn build --skip-test --no-bail --skip-prereqs --skip-compat",
    "extensions": [
        "dbaeumer.vscode-eslint@2.1.5"
    ],
    "remoteUser": "superchain"
}

Expected Behavior

I expected .devcontainer.json to work out of the box.

Current Behavior

I had to make changes to .devcontainer.json.

Reproduction Steps

Open the project using VS Code's Remote - Containers and try to edit any file.

Possible Solution

Explicitly configure the superchain non-root user in .devcontainer.json.

Additional Information/Context

No response

CDK CLI Version

N/A

Framework Version

No response

Node.js Version

N/A

OS

Linux Fedora

Language

Typescript

Language Version

No response

Other information

No response

Metadata

Metadata

Labels

@aws-cdk/aws-workspacesRelated Amazon WorkSpacesbugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.package/toolsRelated to AWS CDK Tools or CLI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions