diff --git a/.github/workflows/sbom.yml b/.github/workflows/sbom.yml index f0309bb..8b6c309 100644 --- a/.github/workflows/sbom.yml +++ b/.github/workflows/sbom.yml @@ -22,7 +22,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 120 container: - image: ${{ vars.SBOM_PIPELINE_IMAGE }} # helm+trivy+python3+bash+git 보유 이미지 + # helm+trivy+python3+bash+git 보유 이미지. doc/scripts/Dockerfile 로 빌드해 푸시한 뒤 + # Repo Variable SBOM_PIPELINE_IMAGE 에 그 태그를 지정한다. (예: docker.io/wbsong111/sbom-pipeline:latest) + image: ${{ vars.SBOM_PIPELINE_IMAGE }} env: OUT_DIR: ${{ github.workspace }}/sbom-out TRIVY_CACHE_DIR: ${{ github.workspace }}/sbom-out/cache diff --git a/doc/sbom-pipeline.md b/doc/sbom-pipeline.md index 84915f2..0513455 100644 --- a/doc/sbom-pipeline.md +++ b/doc/sbom-pipeline.md @@ -33,6 +33,10 @@ manifests/helm/** ──helm template──▶ images_final.tsv ──trivy ima | `trivy` | generate-sbom.sh, scan-sbom.sh | | `python3`, `bash`, `git` | 공통 | +이 이미지는 [doc/scripts/Dockerfile](scripts/Dockerfile) 로 빌드한다(debian/glibc 기반 — CI `container:` +안에서 node 기반 액션 호환). 빌드·푸시 후 태그를 `.github/workflows/sbom.yml` 의 Repo Variable +`SBOM_PIPELINE_IMAGE` 에 지정한다. amd64 필수(GitHub 러너 아키텍처). + ## 스크립트 (`doc/scripts/`) | 스크립트 | 입력 | 출력 | diff --git a/doc/scripts/Dockerfile b/doc/scripts/Dockerfile new file mode 100644 index 0000000..248671a --- /dev/null +++ b/doc/scripts/Dockerfile @@ -0,0 +1,35 @@ +# ============================================================================= +# SBOM 파이프라인 실행 이미지 +# +# .github/workflows/sbom.yml 의 `container:` (Repo Variable SBOM_PIPELINE_IMAGE) +# 로 사용되는 이미지. doc/scripts/*.sh 를 컨테이너 내부에서 직접 실행한다. +# 상세: doc/sbom-pipeline.md +# +# 도구: helm(v3) + trivy + python3 + bash + git +# 베이스: debian(glibc) — GitHub Actions container 안에서 node 기반 액션 +# (actions/checkout, upload-artifact)이 동작하려면 glibc 필요. +# (alpine/musl 은 node 실행 실패 가능 → debian 사용) +# +# 빌드 & 푸시 (amd64 필수 — GitHub 러너가 amd64): +# docker buildx build --platform linux/amd64 \ +# -t docker.io//sbom-pipeline:latest -f doc/scripts/Dockerfile --push doc/scripts +# # 이후: gh variable set SBOM_PIPELINE_IMAGE --body docker.io//sbom-pipeline:latest +# ============================================================================= +FROM debian:stable-slim + +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl ca-certificates git python3 bash \ + && rm -rf /var/lib/apt/lists/* + +# helm v3 +RUN curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash + +# trivy (최신) +RUN curl -fsSL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh \ + | sh -s -- -b /usr/local/bin + +# 설치 확인 (빌드 시 도구 누락 조기 감지) +RUN helm version --short && trivy --version | head -1 && python3 --version && git --version + +ENTRYPOINT [] +CMD ["bash"]