Skip to content

Commit

Permalink
fix(tooling): container user's uid does not match host's uid (#20082)
Browse files Browse the repository at this point in the history
Docker `jsii/superchain` image, which is used as a base image of devcontainer, has a
default non-root user `superchain` which UID is `1001`.

If the container host's workspace directory is not owned by UID `1001`, users may not be
able to modify files inside the container because of the insufficient permission.

.devcontainer.json has a workaround option [`updateRemoteUserUID`](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_general-devcontainerjson-properties)
which updates container's non-root user's UID at runtime.

This PR sets `remoteUser` explicitly in .devcontainer.json to make `updateRemoteUserUID` work.


fixes #19979 

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
sarisia authored Apr 26, 2022
1 parent 9f787a3 commit e9670c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"postCreateCommand": "yarn build --skip-test --no-bail --skip-prereqs --skip-compat",
"extensions": [
"dbaeumer.vscode-eslint@2.1.5"
]
],
"remoteUser": "superchain"
}

0 comments on commit e9670c8

Please sign in to comment.