diff --git a/.github/actions/docker-build-and-push/action.yaml b/.github/actions/docker-build-and-push/action.yaml index 13526e9083e..e2fb347e5c5 100644 --- a/.github/actions/docker-build-and-push/action.yaml +++ b/.github/actions/docker-build-and-push/action.yaml @@ -50,6 +50,17 @@ runs: echo "$EOF" >> $GITHUB_OUTPUT shell: bash + - name: Docker meta for base + id: meta-base + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }} + tags: ${{ steps.set-docker-tags.outputs.tags }} + bake-target: docker-metadata-action-base + flavor: | + latest=false + suffix=-base${{ inputs.tag-suffix }} + - name: Docker meta for prebuilt id: meta-prebuilt uses: docker/metadata-action@v4 @@ -99,9 +110,11 @@ runs: push: ${{ inputs.allow-push == 'true' }} files: | docker/${{ inputs.bake-target }}/docker-bake.hcl + ${{ steps.meta-base.outputs.bake-file }} ${{ steps.meta-prebuilt.outputs.bake-file }} ${{ steps.meta-devel.outputs.bake-file }} targets: | + base prebuilt devel provenance: false @@ -115,6 +128,7 @@ runs: push: true files: | docker/${{ inputs.bake-target }}/docker-bake.hcl + ${{ steps.meta-base.outputs.bake-file }} ${{ steps.meta-devel.outputs.bake-file }} ${{ steps.meta-prebuilt.outputs.bake-file }} ${{ steps.meta-runtime.outputs.bake-file }} @@ -129,6 +143,7 @@ runs: push: false files: | docker/${{ inputs.bake-target }}/docker-bake.hcl + ${{ steps.meta-base.outputs.bake-file }} ${{ steps.meta-devel.outputs.bake-file }} ${{ steps.meta-prebuilt.outputs.bake-file }} ${{ steps.meta-runtime.outputs.bake-file }} diff --git a/docker/autoware-openadk/docker-bake.hcl b/docker/autoware-openadk/docker-bake.hcl index d472a0df008..c1b40c68abf 100644 --- a/docker/autoware-openadk/docker-bake.hcl +++ b/docker/autoware-openadk/docker-bake.hcl @@ -1,12 +1,19 @@ group "default" { - targets = ["prebuilt", "devel", "runtime"] + targets = ["base", "prebuilt", "devel", "runtime"] } // For docker/metadata-action +target "docker-metadata-action-base" {} target "docker-metadata-action-prebuilt" {} target "docker-metadata-action-devel" {} target "docker-metadata-action-runtime" {} +target "base" { + inherits = ["docker-metadata-action-prebuilt"] + dockerfile = "docker/autoware-openadk/Dockerfile" + target = "prebuilt" +} + target "prebuilt" { inherits = ["docker-metadata-action-prebuilt"] dockerfile = "docker/autoware-openadk/Dockerfile"