1+ FROM golang:1.26.1-bookworm AS build
2+ ARG TARGETARCH
3+ RUN apt-get update && apt-get install -y \
4+ jq \
5+ && apt-get clean \
6+ && rm -rf /var/lib/apt/lists/*
7+ COPY src/base/.devcontainer/scripts/install_cosign.sh /tmp/install_cosign.sh
8+ COPY src/base/.devcontainer/scripts/install_trivy.sh /tmp/install_trivy.sh
9+ RUN INSTALL_DIR=/usr/local/bin /tmp/install_cosign.sh
10+ RUN case "${TARGETARCH}" in \
11+ x86_64|amd64) TRIVY_ARCH=64bit ;; \
12+ aarch64|arm64) TRIVY_ARCH=ARM64 ;; \
13+ *) echo "Unsupported TARGETARCH: ${TARGETARCH}" && exit 1 ;; \
14+ esac \
15+ && INSTALL_DIR=/tmp/trivy/ ARCH="${TRIVY_ARCH}" /tmp/install_trivy.sh
16+
17+
118FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
219ARG TARGETARCH
320ENV TARGETARCH=${TARGETARCH}
@@ -64,11 +81,13 @@ RUN git clone https://github.com/awslabs/git-secrets.git /tmp/git-secrets && \
6481 chmod 755 /usr/share/secrets-scanner && \
6582 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
6683
84+ COPY --from=build /tmp/trivy/trivy /usr/local/bin/trivy
85+
6786USER vscode
6887
69- ENV PATH="/home/vscode/.asdf/shims/ :$PATH:/workspaces/eps-devcontainers/node_modules/.bin"
88+ ENV PATH="/home/vscode/.asdf/shims:/home/vscode/.local/bin :$PATH:/workspaces/eps-devcontainers/node_modules/.bin"
7089RUN \
71- echo 'PATH="/home/vscode/.asdf/shims/ :$PATH:/workspaces/eps-devcontainers/node_modules/.bin"' >> ~/.bashrc; \
90+ echo 'PATH="/home/vscode/.asdf/shims:/home/vscode/.local/bin :$PATH:/workspaces/eps-devcontainers/node_modules/.bin"' >> ~/.bashrc; \
7291 echo '. <(asdf completion bash)' >> ~/.bashrc; \
7392 echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc; \
7493 echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc; \
@@ -83,8 +102,7 @@ RUN asdf plugin add python; \
83102 asdf plugin add actionlint; \
84103 asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git; \
85104 asdf plugin add trivy https://github.com/zufardhiyaulhaq/asdf-trivy.git; \
86- asdf plugin add yq https://github.com/sudermanjr/asdf-yq.git
87-
105+ asdf plugin add yq https://github.com/sudermanjr/asdf-yq.git;
88106
89107WORKDIR /workspaces/eps-devcontainers
90108COPY .tool-versions /workspaces/eps-devcontainers/.tool-versions
0 commit comments