Skip to content

Commit c73f412

Browse files
authored
Chore: [AEA-0000] - setup common makefile (#18)
## Summary - Routine Change ### Details - setup common Makefile targets - create seperate image for github actions with user vscode mapped to user id 1001 - add cfn-guard and cfn-lint to image - reduce size of docker images by using zstd compression
1 parent e0808a3 commit c73f412

File tree

24 files changed

+461
-62
lines changed

24 files changed

+461
-62
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
33
{
4-
"name": "Ubuntu",
4+
"name": "eps-devcontainers",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
66
"build": {
77
"dockerfile": "Dockerfile",

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
node_modules
3+
.venv
4+
.out

.github/scripts/delete_unused_images.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,18 @@ delete_pr_images() {
4444
fi
4545

4646
while IFS= read -r tag; do
47-
if [[ "${tag}" =~ ^pr-[0-9]+- ]]; then
48-
local pull_request
47+
local pull_request
48+
if [[ "${tag}" =~ ^pr-([0-9]+)- ]]; then
49+
pull_request=${BASH_REMATCH[1]}
50+
elif [[ "${tag}" =~ ^githubactions-pr-([0-9]+)$ ]]; then
51+
pull_request=${BASH_REMATCH[1]}
52+
else
53+
continue
54+
fi
55+
4956
local pr_json
5057
local pr_state
5158

52-
pull_request=${tag#pr-}
53-
pull_request=${pull_request%%-*}
54-
5559
if ! pr_json=$(gh api \
5660
-H "Accept: application/vnd.github+json" \
5761
"/repos/NHSDigital/eps-devcontainers/pulls/${pull_request}"); then
@@ -75,7 +79,6 @@ delete_pr_images() {
7579
"/orgs/nhsdigital/packages/container/${package_name}/versions/${version_id}"
7680
fi
7781
done
78-
fi
7982
done <<<"${tags}"
8083
}
8184

.github/workflows/build_multi_arch_image.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,17 @@ jobs:
131131
env:
132132
ARCHITECTURE: '${{ matrix.arch }}'
133133
DOCKER_TAG: '${{ inputs.docker_tag }}'
134-
- name: Push tagged image
134+
- name: Push tagged image and rebuild for github actions
135135
run: |
136136
echo "Pushing image..."
137137
docker push "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-${ARCHITECTURE}"
138138
echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-${ARCHITECTURE}" >> "$GITHUB_STEP_SUMMARY"
139+
140+
echo "Rebuilding image for github actions with tag githubactions-${DOCKER_TAG}-${ARCHITECTURE}"
141+
make build-githubactions-image BASE_IMAGE_NAME="${CONTAINER_NAME}" BASE_IMAGE_TAG="${DOCKER_TAG}-${ARCHITECTURE}" IMAGE_TAG="${DOCKER_TAG}-${ARCHITECTURE}" NO_CACHE="${{ inputs.NO_CACHE }}"
142+
echo "Pushing github actions image..."
143+
docker push "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}-${ARCHITECTURE}"
144+
echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}-${ARCHITECTURE}" >> "$GITHUB_STEP_SUMMARY"
139145
env:
140146
DOCKER_TAG: ${{ inputs.docker_tag }}
141147
CONTAINER_NAME: '${{ inputs.container_name }}'
@@ -144,9 +150,14 @@ jobs:
144150
if: ${{ inputs.tag_latest }}
145151
run: |
146152
docker tag "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-${ARCHITECTURE}" "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-${ARCHITECTURE}"
147-
echo "Pushing image..."
153+
echo "Pushing latest image..."
148154
docker push "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-${ARCHITECTURE}"
149155
echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-${ARCHITECTURE}" >> "$GITHUB_STEP_SUMMARY"
156+
157+
docker tag "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}-${ARCHITECTURE}" "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest-${ARCHITECTURE}"
158+
echo "Pushing github actions latest image..."
159+
docker push "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest-${ARCHITECTURE}"
160+
echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest-${ARCHITECTURE}" >> "$GITHUB_STEP_SUMMARY"
150161
env:
151162
DOCKER_TAG: ${{ inputs.docker_tag }}
152163
CONTAINER_NAME: '${{ inputs.container_name }}'
@@ -172,6 +183,7 @@ jobs:
172183
run: |
173184
BUILD_TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
174185
export BUILD_TIMESTAMP
186+
echo "Creating combined image for tag ${DOCKER_TAG}"
175187
docker buildx imagetools create \
176188
--annotation "index:org.opencontainers.image.source=https://github.com/NHSDigital/eps-devcontainers" \
177189
--annotation "index:org.opencontainers.image.description=EPS devcontainer ${CONTAINER_NAME}:${DOCKER_TAG}" \
@@ -184,17 +196,39 @@ jobs:
184196
"ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-amd64" \
185197
"ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}-arm64"
186198
echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:${DOCKER_TAG}" >> "$GITHUB_STEP_SUMMARY"
199+
200+
echo "Creating combined image for tag githubactions-${DOCKER_TAG}"
201+
docker buildx imagetools create \
202+
--annotation "index:org.opencontainers.image.source=https://github.com/NHSDigital/eps-devcontainers" \
203+
--annotation "index:org.opencontainers.image.description=EPS devcontainer ${CONTAINER_NAME}:${DOCKER_TAG}" \
204+
--annotation "index:org.opencontainers.image.licenses=MIT" \
205+
--annotation "index:org.opencontainers.image.version=${DOCKER_TAG}" \
206+
--annotation "index:org.opencontainers.image.containerName=${CONTAINER_NAME}" \
207+
--annotation "index:org.opencontainers.image.created=${BUILD_TIMESTAMP}" \
208+
--annotation "index:org.opencontainers.image.authors=NHS England EPS Team" \
209+
--tag "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}" \
210+
"ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}-amd64" \
211+
"ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}-arm64"
212+
echo "## PUSHED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-${DOCKER_TAG}" >> "$GITHUB_STEP_SUMMARY"
187213
env:
188214
DOCKER_TAG: ${{ inputs.docker_tag }}
189215
CONTAINER_NAME: '${{ inputs.container_name }}'
190216

191217
- name: Push multi-arch latest image
192218
if: ${{ inputs.tag_latest }}
193219
run: |
220+
echo "Creating combined image for tag latest"
194221
docker buildx imagetools create -t "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest" \
195222
"ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-amd64" \
196223
"ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest-arm64"
197224
echo "## PUSHED COMBINED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:latest" >> "$GITHUB_STEP_SUMMARY"
225+
226+
echo "Creating combined image for tag githubactions-latest"
227+
docker buildx imagetools create -t "ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest" \
228+
"ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest-amd64" \
229+
"ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest-arm64"
230+
echo "## PUSHED COMBINED IMAGE : ghcr.io/nhsdigital/eps-devcontainers/${CONTAINER_NAME}:githubactions-latest" >> "$GITHUB_STEP_SUMMARY"
231+
198232
env:
199233
DOCKER_TAG: ${{ inputs.docker_tag }}
200234
CONTAINER_NAME: '${{ inputs.container_name }}'

Makefile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
CONTAINER_PREFIX=ghcr.io/nhsdigital/eps-devcontainers/
22

3-
ifneq ($(strip $(PLATFORM)),)
4-
PLATFORM_FLAG=--platform $(PLATFORM)
5-
endif
6-
73
ifeq ($(strip $(NO_CACHE)),true)
84
NO_CACHE_FLAG=--no-cache
95
endif
@@ -30,9 +26,20 @@ build-image: guard-CONTAINER_NAME guard-BASE_VERSION_TAG guard-BASE_FOLDER guard
3026
--workspace-folder ./src/$${BASE_FOLDER}/$${CONTAINER_NAME} \
3127
$(NO_CACHE_FLAG) \
3228
--push false \
29+
--output type=image,name="${CONTAINER_PREFIX}$${CONTAINER_NAME}:$${IMAGE_TAG}",push=false,compression=zstd \
3330
--cache-from "${CONTAINER_PREFIX}$${CONTAINER_NAME}:latest" \
3431
--image-name "${CONTAINER_PREFIX}$${CONTAINER_NAME}:$${IMAGE_TAG}"
3532

33+
build-githubactions-image: guard-BASE_IMAGE_NAME guard-BASE_IMAGE_TAG guard-IMAGE_TAG
34+
docker buildx build \
35+
-f src/githubactions/Dockerfile \
36+
$(NO_CACHE_FLAG) \
37+
--build-arg BASE_IMAGE_NAME="$${BASE_IMAGE_NAME}" \
38+
--build-arg BASE_IMAGE_TAG="$${BASE_IMAGE_TAG}" \
39+
--load \
40+
-t "${CONTAINER_PREFIX}$${BASE_IMAGE_NAME}:githubactions-$${IMAGE_TAG}" \
41+
.
42+
3643
scan-image: guard-CONTAINER_NAME guard-BASE_FOLDER
3744
@combined="src/$${BASE_FOLDER}/$${CONTAINER_NAME}/.trivyignore_combined.yaml"; \
3845
common="src/common/.trivyignore.yaml"; \

README.md

Lines changed: 93 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ Images are built using using https://github.com/devcontainers/cli.
88

99
We build a base image based on mcr.microsoft.com/devcontainers/base:ubuntu-22.04 that other images are then based on
1010

11-
The images have vsocde user setup as user 1001 so that they can be used in github actions
12-
1311
The base image contains
1412
- latest os packages
1513
- asdf
@@ -109,11 +107,12 @@ This job should be used in github actions wherever you need to get the dev conta
109107
echo "DEVCONTAINER_IMAGE_VERSION=$DEVCONTAINER_VERSION" >> "$GITHUB_OUTPUT"
110108
```
111109
# Project structure
112-
We have 3 types of dev container. These are defined under src
110+
We have 4 types of dev container. These are defined under src
113111

114112
`base` - this is the base image that all others are based on.
115113
`languages` - this installs specific versions of node and python.
116-
`projects` - this is used for projects where more customization is needed than just a base language image
114+
`projects` - this is used for projects where more customization is needed than just a base language image.
115+
`githubactions` - this just takes an existing image and remaps vscode user to be 1001 so it can be used by github actions.
117116

118117
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
119118

@@ -122,16 +121,20 @@ Images under languages should point to a dockerfile under src/common that is bas
122121
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
123122

124123
# Pull requests and merge to main process
125-
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
126-
Docker images are built for each pull request, and on merges to main.
127-
Docker images are built for amd64 and arm64 architecture, and a combined manifest is created and pushed as part of the build.
124+
For each pull request, and merge to main, images are built and scanned using trivy, and pushed to github docker registry.
125+
Docker images are built for amd64 and arm64 architecture, and a combined manifest is created and pushed as part of the build.
126+
The main images have a vscode user with id 1000. A separately tagged image is also created with user vscode mapped to user id 1001 so they can be used by github actions.
128127

129128
The base image is built first, and then language images, and finally project images.
130129

131130
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.
132131

133-
For pull requests, images are tagged with the pr-<pull request id>-<short commit sha>.
134-
For merges to main, images are tagged with the <short commit sha>.
132+
For pull requests, images are tagged with the pr-{pull request id}-{short commit sha}.
133+
For merges to main, images are tagged with the {short commit sha}.
134+
Github actions images are tagged with githubactions-{tag}
135+
Amd64 images are tagged with {tag}-amd64
136+
Arm64 images are tagged with {tag}-arm64
137+
Combined image manifest image is just tagged with {tag} so can be included in devcontainer.json and the correct image is pulled based on the host architecture.
135138

136139
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
137140

@@ -154,7 +157,7 @@ CONTAINER_NAME=base \
154157
```
155158
Language images
156159
```
157-
CONTAINER_NAME=node_24_python_3_13 \
160+
CONTAINER_NAME=node_24_python_3_14 \
158161
BASE_VERSION_TAG=local-build \
159162
BASE_FOLDER=languages \
160163
IMAGE_TAG=local-build \
@@ -168,7 +171,13 @@ CONTAINER_NAME=fhir_facade_api \
168171
IMAGE_TAG=local-build \
169172
make build-image
170173
```
171-
174+
Github actions image
175+
```
176+
BASE_IMAGE_NAME=base \
177+
BASE_IMAGE_TAG=local-build \
178+
IMAGE_TAG=local-build \
179+
make build-githubactions-image
180+
```
172181
## Scanning images
173182
You can use these commands to scan images
174183
Base image
@@ -213,13 +222,39 @@ CONTAINER_NAME=fhir_facade_api \
213222
IMAGE_TAG=local-build \
214223
make shell-image
215224
```
225+
github actions image
226+
```
227+
CONTAINER_NAME=base \
228+
IMAGE_TAG=githubactions-local-build \
229+
make shell-image
230+
```
216231

217-
## Using local or pull request images
232+
## Using local or pull request images in visual studio code
218233
You can use local or pull request images by changing IMAGE_VERSION in devcontainer.json.
219234
For an image built locally, you should put the IMAGE_VERSION=local-build.
220235
For an image built from a pull request, you should put the IMAGE_VERSION=<tag of image as show in pull request job>.
221236
You can only use images built from a pull request for testing changes in github actions.
222237

238+
## Using images in github actions
239+
To use the image in github actions, you can use it in github actions using code like this
240+
```
241+
jobs:
242+
my_job_name:
243+
runs-on: ubuntu-22.04
244+
container:
245+
image: ghcr.io/nhsdigital/eps-devcontainers/<container name>:githubactions-<tag>
246+
options: --user 1001:1001
247+
steps:
248+
- name: copy .tool-versions
249+
run: |
250+
cp /home/vscode/.tool-versions "$HOME/.tool-versions"
251+
... other steps ....
252+
```
253+
It is important that
254+
- the image uses the tag starting githubactions-
255+
- there is `options: --user 1001:1001` below image
256+
- the first step copies .tool-versions from /home/vscode to $HOME/.tool-versions
257+
223258
## Generating a .trivyignore file
224259
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
225260

@@ -238,3 +273,49 @@ poetry run python \
238273
--input .out/scan_results_docker.json \
239274
--output src/projects/fhir_facade_api/.trivyignore.new.yaml
240275
```
276+
277+
## Common makefile targets
278+
There are a set of common Makefiles that are defined in `src/base/.devcontainer/Mk` and are included from `common.mk`. These are installed to /usr/local/share/eps/Mk on the base image so are available for all containers.
279+
280+
This should be added to the end of each projects Makefile to include them
281+
```
282+
%:
283+
@$(MAKE) -f /usr/local/share/eps/Mk/common.mk $@
284+
```
285+
### Targets
286+
The following targets are defined. These are needed for quality checks to run. Some targets are project specific and so should be overridden in the projects Makefile.
287+
288+
Build targets (`build.mk`)
289+
- `install` - placeholder target - should be overridden locally
290+
- `install-node` - placeholder target - should be overridden locally
291+
- `docker-build` - placeholder target - should be overridden locally
292+
- `compile` - placeholder target - should be overridden locally
293+
294+
Check targets (`check.mk`)
295+
- `lint` - placeholder target - should be overridden locally
296+
- `test` - placeholder target - should be overridden locally
297+
- `shellcheck` - runs shellcheck on `scripts/*.sh` and `.github/scripts/*.sh` when files exist
298+
- `cfn-lint` - runs `cfn-lint` against `cloudformation/**/*.yml|yaml` and `SAMtemplates/**/*.yml|yaml`
299+
- `cdk-synth` - placeholder target - should be overridden locally
300+
- `cfn-guard-sam-templates` - validates SAM templates against cfn-guard rulesets and writes outputs to `.cfn_guard_out/`
301+
- `cfn-guard-cloudformation` - validates `cloudformation` templates against cfn-guard rulesets and writes outputs to `.cfn_guard_out/`
302+
- `cfn-guard-cdk` - validates `cdk.out` against cfn-guard rulesets and writes outputs to `.cfn_guard_out/`
303+
- `cfn-guard-terraform` - validates `terraform_plans` against cfn-guard rulesets and writes outputs to `.cfn_guard_out/`
304+
- `actionlint` - runs actionlint against github actions
305+
- `secret-scan` - runs git-secrets (including scanning history) against the repo
306+
- `guard-<ENVIRONMENT_VARIABLE>` - checks if an environment variable is set and errors if it is not
307+
308+
Credentials targets (`credentials.mk`)
309+
- `aws-configure` - configures an AWS sso session
310+
- `aws-login` - Authorizes an sso session with AWS so aws cli tools can be used. You may still need to set AWS_PROFILE before running commands
311+
- `github-login` - Authorizes github cli to github with scope to read packages
312+
- `create-npmrc` - depends on `github-login`, then writes `.npmrc` with a GitHub Packages auth token and `@nhsdigital` registry
313+
314+
Trivy targets (`trivy.mk`)
315+
- `trivy-license-check` - runs Trivy license scan (HIGH/CRITICAL) and writes `.trivy_out/license_scan.txt`
316+
- `trivy-generate-sbom` - generates CycloneDX SBOM at `.trivy_out/sbom.cdx.json`
317+
- `trivy-scan-python` - scans Python dependencies (HIGH/CRITICAL) and writes `.trivy_out/dependency_results_python.txt`
318+
- `trivy-scan-node` - scans Node dependencies (HIGH/CRITICAL) and writes `.trivy_out/dependency_results_node.txt`
319+
- `trivy-scan-go` - scans Go dependencies (HIGH/CRITICAL) and writes `.trivy_out/dependency_results_go.txt`
320+
- `trivy-scan-java` - scans Java dependencies (HIGH/CRITICAL) and writes `.trivy_out/dependency_results_java.txt`
321+
- `trivy-scan-docker` - scans a built image (HIGH/CRITICAL) and writes `.trivy_out/dependency_results_docker.txt` (requires `DOCKER_IMAGE`), for example:

src/base/.devcontainer/Dockerfile

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,37 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
22

33
ARG SCRIPTS_DIR=/usr/local/share/eps
44
ARG CONTAINER_NAME
5-
ARG MULTI_ARCH_TAG
6-
ARG BASE_VERSION_TAG
75
ARG IMAGE_TAG
86
ARG TARGETARCH
97

108
ENV SCRIPTS_DIR=${SCRIPTS_DIR}
119
ENV CONTAINER_NAME=${CONTAINER_NAME}
12-
ENV MULTI_ARCH_TAG=${MULTI_ARCH_TAG}
13-
ENV BASE_VERSION_TAG=${BASE_VERSION_TAG}
14-
ENV IMAGE_TAG=${IMAGE_TAG}
1510
ENV TARGETARCH=${TARGETARCH}
1611

17-
LABEL org.opencontainers.image.source=https://github.com/NHSDigital/eps-devcontainers
18-
LABEL org.opencontainers.image.description="EPS devcontainer ${CONTAINER_NAME}:${IMAGE_TAG}"
19-
LABEL org.opencontainers.image.licenses=MIT
20-
LABEL org.opencontainers.image.version=${IMAGE_TAG}
21-
LABEL org.opencontainers.image.containerName=${CONTAINER_NAME}
22-
LABEL org.opencontainers.image.authors="NHS England EPS Team"
23-
LABEL org.opencontainers.image.base.image="mcr.microsoft.com/devcontainers/base:ubuntu-22.04"
24-
2512
COPY .tool-versions.asdf ${SCRIPTS_DIR}/${CONTAINER_NAME}/.tool-versions.asdf
26-
COPY --chmod=755 scripts ${SCRIPTS_DIR}/${CONTAINER_NAME}
13+
COPY --chmod=755 scripts/root_install.sh ${SCRIPTS_DIR}/${CONTAINER_NAME}/root_install.sh
14+
COPY --chmod=755 Mk ${SCRIPTS_DIR}/Mk
2715

2816
WORKDIR ${SCRIPTS_DIR}/${CONTAINER_NAME}
2917
RUN ./root_install.sh
3018

19+
COPY --chmod=755 scripts/vscode_install.sh ${SCRIPTS_DIR}/${CONTAINER_NAME}/vscode_install.sh
3120
USER vscode
3221
COPY --chown=vscode:vscode .tool-versions.asdf /home/vscode/.tool-versions.asdf
3322
COPY --chown=vscode:vscode .tool-versions /home/vscode/.tool-versions
3423

35-
ENV PATH="/home/vscode/.asdf/shims/:$PATH"
24+
ENV PATH="/home/vscode/.asdf/shims/:/home/vscode/.guard/bin/:$PATH"
3625
WORKDIR ${SCRIPTS_DIR}/${CONTAINER_NAME}
3726
RUN ./vscode_install.sh
3827

3928
# Switch back to root to install the devcontainer CLI globally
4029
USER root
30+
31+
ENV IMAGE_TAG=${IMAGE_TAG}
32+
33+
LABEL org.opencontainers.image.source=https://github.com/NHSDigital/eps-devcontainers
34+
LABEL org.opencontainers.image.description="EPS devcontainer ${CONTAINER_NAME}:${IMAGE_TAG}"
35+
LABEL org.opencontainers.image.licenses=MIT
36+
LABEL org.opencontainers.image.containerName=${CONTAINER_NAME}
37+
LABEL org.opencontainers.image.authors="NHS England EPS Team"
38+
LABEL org.opencontainers.image.base.image="mcr.microsoft.com/devcontainers/base:ubuntu-22.04"

src/base/.devcontainer/Mk/build.mk

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.PHONY: install install-node docker-build compile
2+
install:
3+
echo "Not implemented"
4+
exit 1
5+
6+
install-node:
7+
echo "Not implemented"
8+
exit 1
9+
10+
docker-build:
11+
echo "Not implemented"
12+
exit 1
13+
14+
compile:
15+
echo "Not implemented"
16+
exit 1

0 commit comments

Comments
 (0)