Skip to content

Commit

Permalink
Attempt to get the correct digest for the docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Oct 13, 2024
1 parent e590501 commit 564fe68
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,19 @@ jobs:
run: docker pull ghcr.io/pyca/${{ matrix.IMAGE.TAG_NAME }} || true
if: github.event_name != 'schedule' && github.event_name != 'workflow_dispatch'
- name: Build image
run: docker build --pull --cache-from ghcr.io/pyca/${{ matrix.IMAGE.TAG_NAME }} -t ghcr.io/pyca/${{ matrix.IMAGE.TAG_NAME }} ${{ matrix.IMAGE.DOCKERFILE_PATH }} ${{ matrix.IMAGE.BUILD_ARGS }} --build-arg "NODE_ARCH_RELEASE=${NODE_ARCH_RELEASE}"
run: |
docker build --pull --cache-from ghcr.io/pyca/${{ matrix.IMAGE.TAG_NAME }} \
-t ghcr.io/pyca/${{ matrix.IMAGE.TAG_NAME }} \
--metadata-file metadata.json \
${{ matrix.IMAGE.DOCKERFILE_PATH }} \
${{ matrix.IMAGE.BUILD_ARGS }} --build-arg "NODE_ARCH_RELEASE=${NODE_ARCH_RELEASE}"
- name: Get image digest
id: image-digest
run: |
DIGEST=$(docker inspect --format="{{ .Id }}" "ghcr.io/pyca/${{ matrix.IMAGE.TAG_NAME }}")
echo "DIGEST=${DIGEST}" | tee -a "$GITHUB_OUTPUT"
IMAGE_NAME=$(echo "${{ matrix.IMAGE.TAG_NAME }}" | cut -d ':' -f 1)
echo "IMAGE_NAME=${IMAGE_NAME}" | tee -a "$GITHUB_OUTPUT"
DIGEST=$(jq -r '.["containerimage.digest"]' metadata.json)
echo "DIGEST=${DIGEST}" | tee -a "$GITHUB_OUTPUT"
IMAGE_NAME=$(echo "${{ matrix.IMAGE.TAG_NAME }}" | cut -d ':' -f 1)
echo "IMAGE_NAME=${IMAGE_NAME}" | tee -a "$GITHUB_OUTPUT"
- name: Login to docker
run: 'docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" ghcr.io'
env:
Expand Down

0 comments on commit 564fe68

Please sign in to comment.