diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2bb3a9c..479511a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -56,7 +56,9 @@ jobs: images: ${{ inputs.registry }}/${{ github.repository_owner }}/${{ matrix.target }} tags: | type=edge,enable={{is_default_branch}} + type=ref,event=pr type=match,pattern=(\d{4}\.\d{4}(-.+)?),group=1 + type=raw,value=ubuntu-${{ env.DISTRO_VERSION }},enable=${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') && endsWith(matrix.target, 'bm') }} type=raw,value=v${{ env.OPENMPI_VERSION }},enable=${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') && endsWith(matrix.target, 'openmpi') }} type=raw,value=v${{ env.LAPACK_VERSION }},enable=${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') && endsWith(matrix.target, 'lapack') }} diff --git a/build.json b/build.json index 92dfb21..41e2aa6 100644 --- a/build.json +++ b/build.json @@ -1,5 +1,8 @@ { "variable": { + "DISTRO_VERSION": { + "default": "22.04" + }, "OPENMPI_VERSION": { "default": "4.1.6" }, diff --git a/docker-bake.hcl b/docker-bake.hcl index 1fc3d37..04764ca 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -14,8 +14,7 @@ variable "PLATFORMS" { default = ["linux/amd64"] } -variable "SYSTEM_BASE_IMAGE" { - default = "ubuntu:22.04" +variable "DISTRO_VERSION" { } variable "TARGETS" { @@ -44,7 +43,7 @@ target "bm" { tags = tags("bm") context = "bm" contexts = { - base-image = "docker-image://${SYSTEM_BASE_IMAGE}" + base-image = "docker-image://ubuntu:${DISTRO_VERSION}" } platforms = "${PLATFORMS}" }