File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,7 +74,9 @@ RUN git clone https://github.com/awslabs/git-secrets.git /tmp/git-secrets && \
7474 mkdir -p /usr/share/secrets-scanner && \
7575 chmod 755 /usr/share/secrets-scanner && \
7676 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
77- COPY --from=build /tmp/trivy_amd64/trivy /usr/local/bin/trivy
77+
78+ COPY --from=build /tmp/trivy_${TARGETARCH}/trivy /usr/local/bin/trivy
79+
7880USER vscode
7981
8082ENV PATH="/home/vscode/.asdf/shims:/home/vscode/.local/bin:$PATH:/workspaces/eps-devcontainers/node_modules/.bin"
Original file line number Diff line number Diff line change 3333 echo "node_24_languages=$node_24_language_folders"
3434 echo "projects=$project_folders"
3535 } >> "$GITHUB_OUTPUT"
36- download_trivy :
37- runs-on : ubuntu-latest
38- steps :
39- - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
40- - name : Install cosign
41- run : |
42- ./scripts/install_cosign.sh
43- env :
44- INSTALL_DIR : ${HOME}/.local/bin
45- - name : Get amd64 trivy
46- run : |
47- ./scripts/install_trivy.sh
48- env :
49- INSTALL_DIR : trivy_amd64
50- ARCH : 64bit
51- - name : Get arm64 trivy
52- run : |
53- ./scripts/install_trivy.sh
54- env :
55- INSTALL_DIR : trivy_arm64
56- ARCH : ARM64
57- - uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
58- name : Upload trivy
59- with :
60- name : " trivy"
61- path : |
62- trivy_amd64/trivy
63- trivy_arm64/trivy
6436
6537 package_base_docker_image :
6638 uses : ./.github/workflows/build_multi_arch_image.yml
67- needs : [
68- download_trivy
69- ]
7039 with :
7140 tag_latest : ${{ inputs.tag_latest }}
7241 docker_tag : ${{ inputs.docker_tag }}
Original file line number Diff line number Diff line change @@ -63,14 +63,11 @@ jobs:
6363 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
6464 with :
6565 fetch-depth : 0
66- - name : Download trivy
67- uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
68- with :
69- name : trivy
7066 - name : setup trivy
7167 run : |
72- sudo cp "trivy/trivy_${ARCH}/trivy" /usr/local/bin/
73- chmod +x /usr/local/bin/trivy
68+ docker build --output=/usr/local/bin/ -f "src/trivy/Dockerfile.${ARCH}" .
69+ env :
70+ ARCH : ' ${{ matrix.arch }}'
7471 - name : setup node
7572 uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
7673 with :
Original file line number Diff line number Diff line change 1- FROM golang:1.26.1-bookworm
1+ FROM golang:1.26.1-bookworm AS build
22RUN apt-get update && apt-get install -y \
33 jq \
44 && apt-get clean \
55 && rm -rf /var/lib/apt/lists/*
66COPY scripts/install_cosign.sh /tmp/install_cosign.sh
77COPY scripts/install_trivy.sh /tmp/install_trivy.sh
88RUN INSTALL_DIR=/usr/local/bin /tmp/install_cosign.sh
9- RUN INSTALL_DIR=trivy_arm64 ARCH=ARM64 /tmp/install_trivy.sh
10- RUN INSTALL_DIR=trivy_amd64 ARCH=64bit /tmp/install_trivy.sh
9+ RUN INSTALL_DIR=/tmp/trivy/ ARCH=64bit /tmp/install_trivy.sh
10+
11+ FROM scratch
12+ COPY --from=build /tmp/trivy/trivy /
13+ ENTRYPOINT ["/trivy"]
Original file line number Diff line number Diff line change 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/ ARCH=ARM64 /tmp/install_trivy.sh
10+
11+ FROM scratch
12+ COPY --from=build /tmp/trivy/trivy /
13+ ENTRYPOINT ["/trivy"]
You can’t perform that action at this time.
0 commit comments