Skip to content

Commit

Permalink
Update isle-bagger to 0.0.5 (#21)
Browse files Browse the repository at this point in the history
* Update isle-bagger to 0.0.5
 * Update Isle-Buildkit to v3.4.0 from 3.2.5
 * Cleanup docker-bake.hcl and use contexts
 * Cleanup CI/CD
  • Loading branch information
jefferya authored Aug 23, 2024
1 parent 6e1d50d commit 4d4d3c5
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 19 deletions.
42 changes: 27 additions & 15 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,31 @@ jobs:
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,enable=true,pattern={{version}}
type=semver,enable=true,pattern={{major}}.{{minor}}
type=semver,enable=true,pattern={{major}}
type=ref,enable=true,event=branch
type=ref,enable=false,event=tag
type=ref,enable=false,event=pr
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
# https://github.com/docker/bake-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/bake-action@v5 #v5.3.0
with:
context: .
# push: ${{ github.event_name != 'pull_request' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.event_name != 'pull_request' }}
load: true
#provenance: true
#sbom: true
targets: |
leaf-bagger
files: |
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
#cache-from: type=gha
#cache-to: type=gha,mode=max

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
Expand All @@ -94,9 +105,10 @@ jobs:

# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
# https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.build-and-push.outputs.digest }}
push-to-registry: true
#- name: Generate artifact attestation
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
# # docker/bake-action output path differs; update the following
# subject-digest: ${{ steps.build-and-push.outputs.digest }}
# push-to-registry: true
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BAGGER_TAG
# ---------------------------
# Base build layer
# ---------------------------
FROM --platform=$BUILDPLATFORM ${BAGGER_REPOSITORY:-ghcr.io/cwrc}/isle-bagger:${BAGGER_TAG:-v0.0.4} as base
FROM isle_bagger as base

# Install packages and tools that allow for basic python install.
# python-keystoneclient requirements
Expand Down Expand Up @@ -47,7 +47,7 @@ RUN \
# Production layer
# ---------------------------

FROM --platform=$BUILDPLATFORM ${BAGGER_REPOSITORY:-ghcr.io/cwrc}/isle-bagger:${BAGGER_TAG:-v0.0.4} as prod
FROM isle_bagger as prod

# Install packages and tools that allow for basic downloads.
# cleanup unused base image components
Expand Down
39 changes: 37 additions & 2 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
variable "ISLE_BAGGER_REGISTRY" {
default = "ghcr.io/cwrc"
}
variable "ISLE_BAGGER_VERSION" {
default = "v0.0.5@sha256:4e05219adb36595ddfc51fee33a35ead45fced6b01f57e157bcc01d2608a4aae"
}

###############################################################################
# Common target properties.
###############################################################################
target "common" {
args = {
# Required for reproduciable builds.
# Requires Buildkit 0.11+
# See: https://reproducible-builds.org/docs/source-date-epoch/
# SOURCE_DATE_EPOCH = "${SOURCE_DATE_EPOCH}",
}
}

# https://github.com/docker/metadata-action?tab=readme-ov-file#bake-definition
# bake definition file that can be used with the Docker Bake action. You just
# have to declare an empty target named docker-metadata-action and inherit from it.
target "docker-metadata-action" {}


###############################################################################
# Target.
###############################################################################
# The digest (sha256 hash) is not platform specific but the digest for the manifest of all platforms.
# It will be the digest printed when you do: docker pull alpine:3.17.1
# Not the one displayed on DockerHub.

target "leaf-bagger" {
inherits = ["common", "docker-metadata-action"]
dockerfile = "Dockerfile"
args = {
BAGGER_TAG = "v0.0.4@sha256:668e47efe49280eeef0b004eb11a2d380804d02e333ad24568061e846fe7fb80"
contexts = {
isle_bagger = "docker-image://${ISLE_BAGGER_REGISTRY}/isle-bagger:${ISLE_BAGGER_VERSION}"
#isle_bagger = "docker-image://ISLE_BAGGER_REGISTRY}/drupal:${ISLE_BAGGER_VERSION}"
#BAGGER_TAG = "v0.0.5@sha256:4e05219adb36595ddfc51fee33a35ead45fced6b01f57e157bcc01d2608a4aae"
}
}

0 comments on commit 4d4d3c5

Please sign in to comment.