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
docker tag "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-${ARCHITECTURE}" "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-${ARCHITECTURE}"
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.
@@ -86,22 +146,25 @@ You can use these commands to build images
86
146
Base image
87
147
```
88
148
CONTAINER_NAME=base \
89
-
BASE_VERSION=latest \
149
+
BASE_VERSION_TAG=latest \
90
150
BASE_FOLDER=. \
151
+
IMAGE_TAG=local-build \
91
152
make build-image
92
153
```
93
154
Language images
94
155
```
95
156
CONTAINER_NAME=node_24_python_3_12 \
96
-
BASE_VERSION=latest \
157
+
BASE_VERSION_TAG=local-build \
97
158
BASE_FOLDER=languages \
159
+
IMAGE_TAG=local-build \
98
160
make build-image
99
161
```
100
162
Project images
101
163
```
102
164
CONTAINER_NAME=fhir_facade_api \
103
-
BASE_VERSION=latest \
165
+
BASE_VERSION_TAG=local-build \
104
166
BASE_FOLDER=projects \
167
+
IMAGE_TAG=local-build \
105
168
make build-image
106
169
```
107
170
@@ -111,18 +174,21 @@ Base image
111
174
```
112
175
CONTAINER_NAME=base \
113
176
BASE_FOLDER=. \
177
+
IMAGE_TAG=local-build \
114
178
make scan-image
115
179
```
116
180
Language images
117
181
```
118
182
CONTAINER_NAME=node_24_python_3_12 \
119
183
BASE_FOLDER=languages \
184
+
IMAGE_TAG=local-build \
120
185
make scan-image
121
186
```
122
187
Project images
123
188
```
124
189
CONTAINER_NAME=fhir_facade_api \
125
190
BASE_FOLDER=projects \
191
+
IMAGE_TAG=local-build \
126
192
make scan-image
127
193
```
128
194
@@ -131,19 +197,24 @@ You can use this to start an interactive shell on built images
131
197
base image
132
198
```
133
199
CONTAINER_NAME=base \
200
+
IMAGE_TAG=local-build \
134
201
make shell-image
135
202
```
136
203
Language images
137
204
```
138
205
CONTAINER_NAME=node_24_python_3_12 \
206
+
IMAGE_TAG=local-build \
139
207
make shell-image
140
208
```
141
209
Project images
142
210
```
143
211
CONTAINER_NAME=fhir_facade_api \
212
+
IMAGE_TAG=local-build \
144
213
make shell-image
145
214
```
146
215
216
+
## Using local or pull request images
217
+
You can use local or pull request images by changing IMAGE_VERSION in devcontainer.json
147
218
148
219
## Generating a .trivyignore file
149
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