You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-10Lines changed: 27 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,18 +130,24 @@ It is important that
130
130
- there is `options: --user 1001:1001 --group-add 128` below image to ensure it uses the correct user id and is added to the docker group
131
131
- the default shell is set to be bash
132
132
- the first step copies .tool-versions from /home/vscode to $HOME/.tool-versions
133
+
## Using local or pull request images in visual studio code
134
+
You can use local or pull request images by changing IMAGE_VERSION in devcontainer.json.
135
+
For an image built locally following instructions below, you should put the IMAGE_VERSION=local-build.
136
+
For an image built from a pull request, you should put the IMAGE_VERSION=<tagofimageasshowinpullrequestjob>.
137
+
You can only use images built from a pull request for testing changes in github actions.
133
138
134
139
# Project structure
135
-
We have 4 types of dev container. These are defined under src
140
+
We have 5 types of dev container. These are defined under src
136
141
137
142
`base` - this is the base image that all others are based on.
138
-
`languages` - this installs specific versions of node and python.
143
+
`base_node` - images that install node - most language projects rely on one of these
144
+
`languages` - this installs specific versions of python - normally based off a node image
139
145
`projects` - this is used for projects where more customization is needed than just a base language image.
140
146
`githubactions` - this just takes an existing image and remaps vscode user to be 1001 so it can be used by github actions.
141
147
142
148
Each image to be built contains a .devcontainer folder that defines how the devcontainer should be built. At a minimum, this should contain a devcontainer.json file. See https://containers.dev/implementors/json_reference/ for options for this
143
149
144
-
Images under languages should point to a dockerfile under src/common that is based off the base image. This also runs `.devcontainer/scripts/root_install.sh` and `.devcontainer/scripts/vscode_install.sh` as vscode user as part of the build. These files should be in the language specific folder.
150
+
Images under languages should point to a dockerfile under src/common or src/common_node_24 that is based off the base or node image. This also runs `.devcontainer/scripts/root_install.sh` and `.devcontainer/scripts/vscode_install.sh` as vscode user as part of the build. These files should be in the language specific folder.
145
151
146
152
We use trivy to scan for vulnerabilities in the built docker images. Known vulnerabilities in the base image are in `src/common/.trivyignore.yaml`. Vulnerabilities in specific images are in `.trivyignore.yaml` file in each images folder. These are combined before running a scan to exclude all known vulnerabilities
147
153
@@ -180,6 +186,14 @@ CONTAINER_NAME=base \
180
186
IMAGE_TAG=local-build \
181
187
make build-image
182
188
```
189
+
Base node 24 image
190
+
```
191
+
CONTAINER_NAME=node_24 \
192
+
BASE_VERSION_TAG=local-build \
193
+
BASE_FOLDER=base_node \
194
+
IMAGE_TAG=local-build \
195
+
make build-image
196
+
```
183
197
Language images
184
198
```
185
199
CONTAINER_NAME=node_24_python_3_14 \
@@ -212,11 +226,20 @@ CONTAINER_NAME=base \
212
226
IMAGE_TAG=local-build \
213
227
make scan-image
214
228
```
229
+
Base node 24 image
230
+
```
231
+
CONTAINER_NAME=node_24 \
232
+
BASE_FOLDER=base_node \
233
+
IMAGE_TAG=local-build \
234
+
EXTRA_COMMON=common_node_24 \
235
+
make scan-image
236
+
```
215
237
Language images
216
238
```
217
-
CONTAINER_NAME=node_24_python_3_12 \
239
+
CONTAINER_NAME=node_24_python_3_14 \
218
240
BASE_FOLDER=languages \
219
241
IMAGE_TAG=local-build \
242
+
EXTRA_COMMON=common_node_24 \
220
243
make scan-image
221
244
```
222
245
Project images
@@ -254,12 +277,6 @@ CONTAINER_NAME=base \
254
277
make shell-image
255
278
```
256
279
257
-
## Using local or pull request images in visual studio code
258
-
You can use local or pull request images by changing IMAGE_VERSION in devcontainer.json.
259
-
For an image built locally, you should put the IMAGE_VERSION=local-build.
260
-
For an image built from a pull request, you should put the IMAGE_VERSION=<tagofimageasshowinpullrequestjob>.
261
-
You can only use images built from a pull request for testing changes in github actions.
262
-
263
280
## Generating a .trivyignore file
264
281
You can generate a .trivyignore file for known vulnerabilities by either downloading the json scan output generated by the build, or by generating it locally using the scanning images commands above with a make target of scan-image-json
0 commit comments