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
We have 3 types of dev container. These are defined under src
54
112
@@ -58,9 +116,9 @@ We have 3 types of dev container. These are defined under src
58
116
59
117
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
60
118
61
-
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
119
+
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.
62
120
63
-
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 know vulnerabilities
121
+
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
64
122
65
123
# Pull requests and merge to main process
66
124
For each pull request, and merge to main, images are built and scanned using trivy, but the images are not pushed to github container registry
@@ -72,7 +130,9 @@ The base image is built first, and then language images, and finally project ima
72
130
Docker images are scanned for vulnerabilities using trivy as part of a build step, and the build fails if vulnerabilities are found not in .trivyignore file.
73
131
74
132
For pull requests, images are tagged with the pr-<pullrequestid>-<shortcommitsha>.
75
-
For merges to main, images are tagged with the <shortcommitsha>
133
+
For merges to main, images are tagged with the <shortcommitsha>.
134
+
135
+
When a pull request is merged to main or closed, all associated images are deleted from the registry using the github workflow delete_old_images
76
136
77
137
# Release workflow
78
138
There is a release workflow that runs weekly at 18:00 on Thursday and on demand.
@@ -114,18 +174,21 @@ Base image
114
174
```
115
175
CONTAINER_NAME=base \
116
176
BASE_FOLDER=. \
177
+
IMAGE_TAG=local-build \
117
178
make scan-image
118
179
```
119
180
Language images
120
181
```
121
182
CONTAINER_NAME=node_24_python_3_12 \
122
183
BASE_FOLDER=languages \
184
+
IMAGE_TAG=local-build \
123
185
make scan-image
124
186
```
125
187
Project images
126
188
```
127
189
CONTAINER_NAME=fhir_facade_api \
128
190
BASE_FOLDER=projects \
191
+
IMAGE_TAG=local-build \
129
192
make scan-image
130
193
```
131
194
@@ -134,19 +197,24 @@ You can use this to start an interactive shell on built images
134
197
base image
135
198
```
136
199
CONTAINER_NAME=base \
200
+
IMAGE_TAG=local-build \
137
201
make shell-image
138
202
```
139
203
Language images
140
204
```
141
205
CONTAINER_NAME=node_24_python_3_12 \
206
+
IMAGE_TAG=local-build \
142
207
make shell-image
143
208
```
144
209
Project images
145
210
```
146
211
CONTAINER_NAME=fhir_facade_api \
212
+
IMAGE_TAG=local-build \
147
213
make shell-image
148
214
```
149
215
216
+
## Using local or pull request images
217
+
You can use local or pull request images by changing IMAGE_VERSION in devcontainer.json
150
218
151
219
## Generating a .trivyignore file
152
220
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