Skip to content

Commit f271168

Browse files
authored
chore: update vscode devcontainer config (#32315)
### Issue # (if applicable) Closes #<issue number here>. 1. remove `sudo` usage in dockerfile 2. upgrade DinD for Apple Silicon ### Reason for this change ### Description of changes 1. following best practice [here](https://semgrep.dev/r?q=dockerfile.security.no-sudo-in-dockerfile.no-sudo-in-dockerfile) 2. upgrade DinD to the latest version to support Apple Silicon. ### Description of how you validated changes reopen the devcontainer in vscode on my laptop <img width="496" alt="image" src="https://github.com/user-attachments/assets/dee28dc7-19be-41b6-8d9b-72c0a994c8b0"> ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent f9708a6 commit f271168

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

.devcontainer/Dockerfile

+10-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ FROM jsii/superchain:1-bookworm-slim-node20
22

33
USER root
44

5+
# Setup oh-my-zsh
6+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
7+
&& apt-get -y install --no-install-recommends zsh vim \
8+
&& rm -rf /var/lib/apt/lists/* \
9+
&& chsh -s $(which zsh) superchain
10+
11+
# Required, otherwise shell is extermly slow due the size of the aws-cdk
12+
RUN sh -c 'echo "[oh-my-zsh]\n hide-dirty = 1" > /etc/gitconfig'
13+
514
# Change uid/guid of superchain so it can work with the docker-in-docker feature
615
RUN groupmod --gid 1000 superchain \
716
&& usermod --uid 1000 --gid 1000 superchain \
@@ -10,10 +19,4 @@ RUN groupmod --gid 1000 superchain \
1019
USER superchain
1120

1221
# Setup oh-my-zsh
13-
RUN sudo apt-get update && export DEBIAN_FRONTEND=noninteractive \
14-
&& sudo apt-get -y install --no-install-recommends zsh vim \
15-
&& sudo rm -rf /var/lib/apt/lists/* \
16-
&& sudo chsh -s $(which zsh) $(whoami)
17-
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended \
18-
# Required, otherwise shell is extermly slow due the size of the aws-cdk
19-
&& sudo sh -c 'echo "[oh-my-zsh]\n hide-dirty = 1" > /etc/gitconfig'
22+
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

.devcontainer/devcontainer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
"build": {
44
"dockerfile": "Dockerfile"
55
},
6-
76
"customizations": {
87
"vscode": {
9-
"extensions": ["dbaeumer.vscode-eslint"]
8+
"extensions": [
9+
"dbaeumer.vscode-eslint"
10+
]
1011
}
1112
},
12-
1313
"postCreateCommand": "yarn install",
1414
"remoteUser": "superchain",
1515
"features": {
16-
"docker-in-docker": {
16+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
1717
"version": "latest",
1818
"moby": true
1919
}

0 commit comments

Comments
 (0)