Skip to content

Commit 7abad14

Browse files
pauldoomgovjeffmendoza
authored andcommitted
Build chainguard/busybox based images for use with GitHub Actions
We would like the option of running AllStar as a GitHub Action. The current container image uses `cgr.dev/chainguard/static` which is an excellent minimal base with very little surface area. Unfortunately, GitHub Actions requires `tail` to be available for use as a container: ~~~sh /usr/bin/docker create --name ... --label ... --workdir /__w/.allstar/.allstar --network ... -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/runners/2.306.0/externals":"/__e":ro -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflo→ ~~~ This change updates the build workflow to build a second image based on `cgr.dev/chainguard/busybox` with the tag `VERSION-busybox`. Combining this image with use of the `-once` flag makes it possible to run AllStar in GitHub Actions. Example GitHub Actions jobs YAML: ~~~ name: "Scheduled AllStar Enforcement" on: schedule: - cron: "0 * * * *" jobs: deployment: runs-on: ubuntu-latest container: ghcr.io/ossf/allstar:v3.1-busybox environment: prod steps: - name: "AllStar Enforce" env: APP_ID: ${{ vars.APP_ID }} KEY_SECRET: ${{ vars.KEY_SECRET }} PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} run: /ko-app/allstar -once ~~~ The standard minimal `cgr.dev/chainguard/stable` images are still built. Signed-off-by: Paul Hirsch <[email protected]>
1 parent d2772b7 commit 7abad14

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/release.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,19 @@ jobs:
3030
- run: ko publish -B ./cmd/allstar --tags ${{ github.ref_name }} --image-refs allstar.ref
3131
env:
3232
KO_DOCKER_REPO: ghcr.io/${{ github.repository_owner }}
33-
33+
- run: ko publish -B ./cmd/allstar --tags ${{ github.ref_name }}-busybox --image-refs allstar-busybox.ref
34+
env:
35+
KO_DOCKER_REPO: ghcr.io/${{ github.repository_owner }}
36+
KO_DEFAULTBASEIMAGE: cgr.dev/chainguard/busybox
3437
- run: |
3538
echo "signing $(cat allstar.ref)"
3639
cosign sign --yes -a git_sha="$GITHUB_SHA" "$(cat allstar.ref)"
40+
echo "signing $(cat allstar-busybox.ref)"
41+
cosign sign --yes -a git_sha="$GITHUB_SHA" "$(cat allstar-busybox.ref)"
3742
38-
- run: gh release create ${{ github.ref_name }} --notes "ghcr.io/${{ github.repository_owner }}/allstar:${{ github.ref_name }}"
43+
- run: |
44+
gh release create ${{ github.ref_name }} --notes "Images:
45+
* ghcr.io/${{ github.repository_owner }}/allstar:${{ github.ref_name }}
46+
* ghcr.io/${{ github.repository_owner }}/allstar:${{ github.ref_name }}-busybox"
3947
env:
4048
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)