1+ FROM golang:1.26.1-bookworm AS build
2+ RUN apt-get update && apt-get install -y \
3+ jq \
4+ && apt-get clean \
5+ && rm -rf /var/lib/apt/lists/*
6+ COPY scripts/install_cosign.sh /tmp/install_cosign.sh
7+ COPY scripts/install_trivy.sh /tmp/install_trivy.sh
8+ RUN INSTALL_DIR=/usr/local/bin /tmp/install_cosign.sh
9+ RUN INSTALL_DIR=/tmp/trivy_arm64 ARCH=ARM64 /tmp/install_trivy.sh
10+ RUN INSTALL_DIR=/tmp/trivy_amd64 ARCH=64bit /tmp/install_trivy.sh
11+
112FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
213ARG TARGETARCH
314ENV TARGETARCH=${TARGETARCH}
@@ -63,7 +74,7 @@ RUN git clone https://github.com/awslabs/git-secrets.git /tmp/git-secrets && \
6374 mkdir -p /usr/share/secrets-scanner && \
6475 chmod 755 /usr/share/secrets-scanner && \
6576 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
66-
77+ COPY --from=build /tmp/trivy_amd64/trivy /usr/local/bin/trivy
6778USER vscode
6879
6980ENV PATH="/home/vscode/.asdf/shims:/home/vscode/.local/bin:$PATH:/workspaces/eps-devcontainers/node_modules/.bin"
@@ -83,9 +94,7 @@ RUN asdf plugin add python; \
8394 asdf plugin add actionlint; \
8495 asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git; \
8596 asdf plugin add trivy https://github.com/zufardhiyaulhaq/asdf-trivy.git; \
86- asdf plugin add yq https://github.com/sudermanjr/asdf-yq.git; \
87- asdf plugin add golang
88-
97+ asdf plugin add yq https://github.com/sudermanjr/asdf-yq.git;
8998
9099WORKDIR /workspaces/eps-devcontainers
91100COPY .tool-versions /workspaces/eps-devcontainers/.tool-versions
@@ -95,10 +104,5 @@ COPY .tool-versions /home/vscode/.tool-versions
95104RUN asdf install python; \
96105 asdf install
97106
98- COPY scripts/install_cosign.sh /tmp/install_cosign.sh
99- COPY scripts/install_trivy.sh /tmp/install_trivy.sh
100- RUN INSTALL_DIR=/home/vscode/.local/bin /tmp/install_cosign.sh
101- RUN INSTALL_DIR=/home/vscode/.local/bin /tmp/install_trivy.sh
102-
103107RUN git-secrets --register-aws --global && \
104108 git-secrets --add-provider --global -- cat /usr/share/secrets-scanner/nhsd-rules-deny.txt
0 commit comments