Skip to content

Commit 989120c

Browse files
committed
use new image again
1 parent 2478485 commit 989120c

4 files changed

Lines changed: 53 additions & 121 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
ARG IMAGE_NAME=node_24_python_3_14
12
ARG IMAGE_VERSION=latest
2-
ARG IMAGE=node_24_python_3_14
3-
FROM ghcr.io/nhsdigital/eps-devcontainers/${IMAGE}:${IMAGE_VERSION}
3+
FROM ghcr.io/nhsdigital/eps-devcontainers/${IMAGE_NAME}:${IMAGE_VERSION}
44

55
USER root
66
# specify DOCKER_GID to force container docker group id to match host
@@ -12,8 +12,3 @@ RUN if [ -n "${DOCKER_GID}" ]; then \
1212
fi && \
1313
usermod -aG docker vscode; \
1414
fi
15-
16-
# fix vscode user back to 1000
17-
RUN usermod -u 1000 vscode; \
18-
groupmod -g 1000 vscode; \
19-
chown -R vscode:vscode /home/vscode

.devcontainer/devcontainer.json

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
11
{
2-
"name": "Ubuntu",
2+
"name": "eps-common-workflows",
33
"build": {
44
"dockerfile": "Dockerfile",
55
"context": "..",
66
"args": {
77
"DOCKER_GID": "${env:DOCKER_GID:}",
8-
"IMAGE_VERSION": "pr-16-36dcbc3",
9-
"IMAGE": "node_24_python_3_14"
8+
"IMAGE_NAME": "node_24_python_3_14",
9+
"IMAGE_VERSION": "e0808a3",
10+
"USER_UID": "${localEnv:USER_ID:}",
11+
"USER_GID": "${localEnv:GROUP_ID:}"
1012
},
11-
"postAttachCommand": "git-secrets --register-aws; git-secrets --add-provider -- cat /usr/share/secrets-scanner/nhsd-rules-deny.txt",
12-
"mounts": [
13-
"source=${env:HOME}${env:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind",
14-
"source=${env:HOME}${env:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind",
15-
"source=${env:HOME}${env:USERPROFILE}/.gnupg,target=/home/vscode/.gnupg,type=bind",
16-
"source=${env:HOME}${env:USERPROFILE}/.npmrc,target=/home/vscode/.npmrc,type=bind"
17-
],
18-
"containerUser": "vscode",
19-
"remoteEnv": {
20-
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
21-
},
22-
"features": {},
23-
"customizations": {
24-
"vscode": {
25-
"extensions": [
26-
"AmazonWebServices.aws-toolkit-vscode",
27-
"redhat.vscode-yaml",
28-
"eamodio.gitlens",
29-
"github.vscode-pull-request-github",
30-
"streetsidesoftware.code-spell-checker",
31-
"timonwong.shellcheck",
32-
"github.vscode-github-actions"
33-
],
34-
"settings": {
35-
"cSpell.words": [
36-
"fhir",
37-
"Formik",
38-
"pino",
39-
"serialisation"
40-
]
41-
}
13+
"updateRemoteUserUID": false
14+
},
15+
"postAttachCommand": "git-secrets --register-aws; git-secrets --add-provider -- cat /usr/share/secrets-scanner/nhsd-rules-deny.txt",
16+
"mounts": [
17+
"source=${env:HOME}${env:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind",
18+
"source=${env:HOME}${env:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind",
19+
"source=${env:HOME}${env:USERPROFILE}/.gnupg,target=/home/vscode/.gnupg,type=bind",
20+
"source=${env:HOME}${env:USERPROFILE}/.npmrc,target=/home/vscode/.npmrc,type=bind"
21+
],
22+
"containerUser": "vscode",
23+
"remoteEnv": {
24+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
25+
},
26+
"features": {},
27+
"customizations": {
28+
"vscode": {
29+
"extensions": [
30+
"AmazonWebServices.aws-toolkit-vscode",
31+
"redhat.vscode-yaml",
32+
"eamodio.gitlens",
33+
"github.vscode-pull-request-github",
34+
"streetsidesoftware.code-spell-checker",
35+
"timonwong.shellcheck",
36+
"github.vscode-github-actions"
37+
],
38+
"settings": {
39+
"cSpell.words": [
40+
"fhir",
41+
"Formik",
42+
"pino",
43+
"serialisation"
44+
]
4245
}
4346
}
4447
}

.github/workflows/quality-checks.yml

Lines changed: 13 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,10 @@ jobs:
3636
ref: ${{ env.BRANCH_NAME }}
3737
fetch-depth: 0
3838
- name: Run secrets scan
39-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
39+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
4040
with:
4141
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
42-
options: >
43-
-v ${{ github.workspace }}:/work
44-
-u 1001:1001
4542
run: |
46-
cd /work
4743
git-secrets --scan-history .
4844
4945
- &setup_npmrc
@@ -62,26 +58,10 @@ jobs:
6258
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
6359

6460
- name: make install
65-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
61+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
6662
with:
6763
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
68-
options: >
69-
-v ${{ github.workspace }}:/work
70-
-u 1001:1001
7164
run: |
72-
cd /work
73-
echo "Running id"
74-
id
75-
echo "Running pwd"
76-
pwd
77-
echo "home is $HOME"
78-
echo "running asdf plugin list"
79-
asdf plugin list
80-
echo "Checking mount"
81-
ls -l /
82-
echo $PATH
83-
export PATH="$HOME/.asdf/shims:$PATH"
84-
echo "running make install"
8565
make install
8666
8767
- name: Check language tools used and setup trivy config
@@ -138,14 +118,10 @@ jobs:
138118
cmd: yq -i '.pkg.include-dev-deps = true' 'trivy.yaml'
139119
- name: convert python dependencies to requirements.txt
140120
if: ${{ steps.check_languages.outputs.uses_poetry == 'true' }}
141-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
121+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
142122
with:
143123
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
144-
options: >
145-
-v ${{ github.workspace }}:/work
146-
-u 1001:1001
147124
run: |
148-
cd /work
149125
POETRY_VERSION=$(poetry --version | awk '{print $3}')
150126
151127
if [[ "$(printf '%s\n' "2.0.0" "$POETRY_VERSION" "3.0.0" | sort -V | head -n1)" == "2.0.0" ]] \
@@ -158,14 +134,10 @@ jobs:
158134
poetry export -f requirements.txt --with dev --without-hashes --output=requirements.txt
159135
- name: download go dependencies
160136
if: ${{ steps.check_languages.outputs.uses_go == 'true' }}
161-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
137+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
162138
with:
163139
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
164-
options: >
165-
-v ${{ github.workspace }}:/work
166-
-u 1001:1001
167140
run: |
168-
cd /work
169141
cd src
170142
go mod vendor
171143
- name: Check licenses
@@ -198,14 +170,10 @@ jobs:
198170
cat license_scan.txt
199171
fi
200172
- name: Run code lint
201-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
173+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
202174
with:
203175
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
204-
options: >
205-
-v ${{ github.workspace }}:/work
206-
-u 1001:1001
207176
run: |
208-
cd /work
209177
make lint
210178
211179
- name: Run ShellCheck
@@ -218,14 +186,10 @@ jobs:
218186
.git
219187
220188
- name: Run unit tests
221-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
189+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
222190
with:
223191
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
224-
options: >
225-
-v ${{ github.workspace }}:/work
226-
-u 1001:1001
227192
run: |
228-
cd /work
229193
make test
230194
- name: Generate SBOM
231195
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
@@ -509,14 +473,10 @@ jobs:
509473
510474
- name: Run cfn-lint
511475
if: steps.check_sam_templates.outputs.sam_exists == 'true' || steps.check_cf_templates.outputs.cf_exists == 'true'
512-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
476+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
513477
with:
514478
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
515-
options: >
516-
-v ${{ github.workspace }}:/work
517-
-u 1001:1001
518479
run: |
519-
cd /work
520480
pip install cfn-lint
521481
cfn-lint -I "cloudformation/**/*.y*ml" 2>&1 | awk '/Run scan/ { print } /^[EW][0-9]/ { print; getline; print }'
522482
cfn-lint -I "SAMtemplates/**/*.y*ml" 2>&1 | awk '/Run scan/ { print } /^[EW][0-9]/ { print; getline; print }'
@@ -526,37 +486,25 @@ jobs:
526486

527487
- name: make install NodeJS
528488
if: steps.check_cdk.outputs.cdk_exists == 'true'
529-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
489+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
530490
with:
531491
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
532-
options: >
533-
-v ${{ github.workspace }}:/work
534-
-u 1001:1001
535492
run: |
536-
cd /work
537493
make install-node && make compile
538494
539495
- name: Run cdk-synth
540496
if: steps.check_cdk.outputs.cdk_exists == 'true'
541-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
497+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
542498
with:
543499
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
544-
options: >
545-
-v ${{ github.workspace }}:/work
546-
-u 1001:1001
547500
run: |
548-
cd /work
549501
make cdk-synth
550502
551503
- name: Init cfn-guard
552-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
504+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
553505
with:
554506
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
555-
options: >
556-
-v ${{ github.workspace }}:/work
557-
-u 1001:1001
558507
run: |
559-
cd /work
560508
set -eou pipefail
561509
562510
rm -rf /tmp/ruleset
@@ -571,14 +519,10 @@ jobs:
571519
572520
- name: Run cfn-guard script for sam templates
573521
if: steps.check_sam_templates.outputs.sam_exists == 'true'
574-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
522+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
575523
with:
576524
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
577-
options: >
578-
-v ${{ github.workspace }}:/work
579-
-u 1001:1001
580525
run: |
581-
cd /work
582526
set -eou pipefail
583527
584528
declare -a rulesets=("ncsc" "ncsc-cafv3" "wa-Reliability-Pillar" "wa-Security-Pillar")
@@ -602,15 +546,10 @@ jobs:
602546
603547
- name: Run cfn-guard script for cloudformation templates
604548
if: steps.check_cf_templates.outputs.cf_exists == 'true'
605-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
549+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
606550
with:
607551
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
608-
options: >
609-
-v ${{ github.workspace }}:/work
610-
-u 1001:1001
611552
run: |
612-
cd /work
613-
614553
declare -a rulesets=("ncsc" "ncsc-cafv3" "wa-Reliability-Pillar" "wa-Security-Pillar")
615554
for ruleset in "${rulesets[@]}"
616555
do
@@ -625,15 +564,10 @@ jobs:
625564
626565
- name: Run cfn-guard script for cdk templates
627566
if: steps.check_cdk.outputs.cdk_exists == 'true'
628-
uses: addnab/docker-run-action@5ddaad0f7eedd03f64e412b1931852bd3031b273
567+
uses: anthony-nhs/docker-run-action-fork@4d62f8d0e1ae07c4b0abad4eac02db8fa7bc984b
629568
with:
630569
image: ghcr.io/nhsdigital/eps-devcontainers/${{ inputs.runtime_docker_image }}
631-
options: >
632-
-v ${{ github.workspace }}:/work
633-
-u 1001:1001
634570
run: |
635-
cd /work
636-
637571
declare -a rulesets=("ncsc" "ncsc-cafv3" "wa-Reliability-Pillar" "wa-Security-Pillar")
638572
for ruleset in "${rulesets[@]}"
639573
do

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
entry: bash
2424
args:
2525
- -c
26-
- 'docker run -v "$LOCAL_WORKSPACE_FOLDER:/src" git-secrets --pre_commit_hook'
26+
- "git-secrets --pre_commit_hook"
2727
language: system
2828
- id: lint-githubactions
2929
name: Lint github actions

0 commit comments

Comments
 (0)