Skip to content

Commit

Permalink
Merge pull request #97 from cyber-dojo/add-digest-to-base-image
Browse files Browse the repository at this point in the history
Add digest to BASE_IMAGE
  • Loading branch information
JonJagger authored Feb 2, 2025
2 parents b6faa28 + 867d640 commit bd8862f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/base_image_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ name: Base Image Update
on:
workflow_dispatch:
inputs:
base_image:
description: "Image-Tag for cyberdojo/docker-base (short commit SHA - first 7 digits) eg edb2887"
base_image_tag:
description: "Image-Tag for cyberdojo/docker-base (short commit SHA - first 7 digits), eg d6830c0"
required: true
base_image_digest:
description: "Image-Digest for cyberdojo/docker-base, eg 4be745df9..."
required: true

jobs:
Expand All @@ -17,8 +20,9 @@ jobs:
- name: Outputs
id: vars
run: |
echo "base_image=cyberdojo/docker-base:${{ inputs.base_image }}" >> ${GITHUB_OUTPUT}
echo "kosli_trail=base-image-update-${{ inputs.base_image }}" >> ${GITHUB_OUTPUT}
TAG_WITH_DIGEST="${{ inputs.base_image_tag }}@sha256:${{ inputs.base_image_digest }}"
echo "base_image=cyberdojo/docker-base:${TAG_WITH_DIGEST}" >> ${GITHUB_OUTPUT}
echo "kosli_trail=base-image-update-${{ inputs.base_image_tag }}" >> ${GITHUB_OUTPUT}
trigger:
needs: [setup]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
no-cache: true
push: true
tags: ${{ env.IMAGE_NAME }}
build-args: |
Expand Down
6 changes: 3 additions & 3 deletions bin/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ set -Eeu

echo_base_image()
{
local -r json="$(curl --fail --silent --request GET https://beta.cyber-dojo.org/runner/base_image)"
echo "${json}" | jq -r '.base_image'
# echo cyberdojo/docker-base:d6830c0@sha256:4be745df921403085fd2626b1013707352d81a1a943b2cc8c198300246d6f6f7
# local -r json="$(curl --fail --silent --request GET https://beta.cyber-dojo.org/runner/base_image)"
# echo "${json}" | jq -r '.base_image'
echo cyberdojo/docker-base:d6830c0@sha256:4be745df921403085fd2626b1013707352d81a1a943b2cc8c198300246d6f6f7
}

echo_env_vars()
Expand Down

0 comments on commit bd8862f

Please sign in to comment.