1+ FROM alpine:3.23.3 AS build
2+ ARG TARGETARCH
3+ RUN apk add --no-cache cosign bash curl jq
4+ COPY src/base/.devcontainer/scripts/install_trivy.sh /tmp/install_trivy.sh
5+ RUN case "${TARGETARCH}" in \
6+ x86_64|amd64) TRIVY_ARCH=64bit ;; \
7+ aarch64|arm64) TRIVY_ARCH=ARM64 ;; \
8+ *) echo "Unsupported TARGETARCH: ${TARGETARCH}" && exit 1 ;; \
9+ esac \
10+ && INSTALL_DIR=/tmp/trivy/ ARCH="${TRIVY_ARCH}" /tmp/install_trivy.sh
11+
12+
113FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
214ARG TARGETARCH
315ENV TARGETARCH=${TARGETARCH}
@@ -64,11 +76,13 @@ RUN git clone https://github.com/awslabs/git-secrets.git /tmp/git-secrets && \
6476 chmod 755 /usr/share/secrets-scanner && \
6577 curl -L https://raw.githubusercontent.com/NHSDigital/software-engineering-quality-framework/main/tools/nhsd-git-secrets/nhsd-rules-deny.txt -o /usr/share/secrets-scanner/nhsd-rules-deny.txt
6678
79+ COPY --from=build /tmp/trivy/trivy /usr/local/bin/trivy
80+
6781USER vscode
6882
69- ENV PATH="/home/vscode/.asdf/shims/ :$PATH:/workspaces/eps-devcontainers/node_modules/.bin"
83+ ENV PATH="/home/vscode/.asdf/shims:/home/vscode/.local/bin :$PATH:/workspaces/eps-devcontainers/node_modules/.bin"
7084RUN \
71- echo 'PATH="/home/vscode/.asdf/shims/ :$PATH:/workspaces/eps-devcontainers/node_modules/.bin"' >> ~/.bashrc; \
85+ echo 'PATH="/home/vscode/.asdf/shims:/home/vscode/.local/bin :$PATH:/workspaces/eps-devcontainers/node_modules/.bin"' >> ~/.bashrc; \
7286 echo '. <(asdf completion bash)' >> ~/.bashrc; \
7387 echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc; \
7488 echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc; \
@@ -82,9 +96,7 @@ RUN asdf plugin add python; \
8296 asdf plugin add direnv; \
8397 asdf plugin add actionlint; \
8498 asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git; \
85- asdf plugin add trivy https://github.com/zufardhiyaulhaq/asdf-trivy.git; \
86- asdf plugin add yq https://github.com/sudermanjr/asdf-yq.git
87-
99+ asdf plugin add yq https://github.com/sudermanjr/asdf-yq.git;
88100
89101WORKDIR /workspaces/eps-devcontainers
90102COPY .tool-versions /workspaces/eps-devcontainers/.tool-versions
0 commit comments