diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 2cb0dafb2..46bae7c3c 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -8,6 +8,8 @@ outputs: value: ${{ steps.meta.outputs.tags }} image-labels: value: ${{ steps.meta.outputs.labels }} + bake-file: + value: ${{ steps.meta.outputs.bake-file }} cache-name: value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:cache runs: @@ -54,6 +56,7 @@ runs: id: meta uses: docker/metadata-action@v5 with: + bake-target: docker-metadata-action # list of Docker images to use as base name for tags images: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }} tags: type=raw,value=${{ steps.create-short-sha.outputs.SHORT_SHA }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cca8c4e67..270f45b57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,9 @@ jobs: source: . push: true targets: rpi - files: docker/rpi/rpi.hcl + files: | + docker/rpi/rpi.hcl + ${{ steps.setup.outputs.bake-file }} set: | rpi.tags=${{ steps.setup.outputs.image-name }}-rpi *.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64 @@ -102,7 +104,9 @@ jobs: source: . push: true targets: tensorrt - files: docker/tensorrt/trt.hcl + files: | + docker/tensorrt/trt.hcl + ${{ steps.setup.outputs.bake-file }} set: | tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt-jp6 *.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp6 @@ -130,7 +134,9 @@ jobs: source: . push: true targets: tensorrt - files: docker/tensorrt/trt.hcl + files: | + docker/tensorrt/trt.hcl + ${{ steps.setup.outputs.bake-file }} set: | tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt *.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt @@ -144,7 +150,9 @@ jobs: source: . push: true targets: rocm - files: docker/rocm/rocm.hcl + files: | + docker/rocm/rocm.hcl + ${{ steps.setup.outputs.bake-file }} set: | rocm.tags=${{ steps.setup.outputs.image-name }}-rocm *.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rocm,mode=max @@ -170,7 +178,9 @@ jobs: source: . push: true targets: rk - files: docker/rockchip/rk.hcl + files: | + docker/rockchip/rk.hcl + ${{ steps.setup.outputs.bake-file }} set: | rk.tags=${{ steps.setup.outputs.image-name }}-rk *.cache-from=type=gha diff --git a/docker/rockchip/rk.hcl b/docker/rockchip/rk.hcl index 9424b46e7..38881d238 100644 --- a/docker/rockchip/rk.hcl +++ b/docker/rockchip/rk.hcl @@ -1,3 +1,5 @@ +target "docker-metadata-action" {} + target wheels { dockerfile = "docker/main/Dockerfile" platforms = ["linux/arm64"] @@ -18,10 +20,11 @@ target rootfs { target rk { dockerfile = "docker/rockchip/Dockerfile" + inherits = ["docker-metadata-action"] contexts = { wheels = "target:wheels", deps = "target:deps", rootfs = "target:rootfs" } platforms = ["linux/arm64"] -} \ No newline at end of file +} diff --git a/docker/rocm/rocm.hcl b/docker/rocm/rocm.hcl index 0745a9f3d..c89674ef0 100644 --- a/docker/rocm/rocm.hcl +++ b/docker/rocm/rocm.hcl @@ -11,6 +11,8 @@ variable "HSA_OVERRIDE" { default = "1" } +target "docker-metadata-action" {} + target wget { dockerfile = "docker/main/Dockerfile" platforms = ["linux/amd64"] @@ -31,6 +33,7 @@ target rootfs { target rocm { dockerfile = "docker/rocm/Dockerfile" + inherits = ["docker-metadata-action"] contexts = { deps = "target:deps", wget = "target:wget", diff --git a/docker/rpi/rpi.hcl b/docker/rpi/rpi.hcl index 66f97c16d..5652ee29d 100644 --- a/docker/rpi/rpi.hcl +++ b/docker/rpi/rpi.hcl @@ -1,3 +1,5 @@ +target "docker-metadata-action" {} + target deps { dockerfile = "docker/main/Dockerfile" platforms = ["linux/arm64"] @@ -12,9 +14,10 @@ target rootfs { target rpi { dockerfile = "docker/rpi/Dockerfile" + inherits = ["docker-metadata-action"] contexts = { deps = "target:deps", rootfs = "target:rootfs" } platforms = ["linux/arm64"] -} \ No newline at end of file +} diff --git a/docker/tensorrt/trt.hcl b/docker/tensorrt/trt.hcl index 501e871e9..69ababbc6 100644 --- a/docker/tensorrt/trt.hcl +++ b/docker/tensorrt/trt.hcl @@ -29,6 +29,8 @@ fi EOT } +target "docker-metadata-action" {} + target "_build_args" { args = { BASE_IMAGE = BASE_IMAGE, @@ -81,6 +83,7 @@ target "trt-deps" { target "tensorrt" { dockerfile = "docker/tensorrt/Dockerfile.${ARCH}" + inherits = ["docker-metadata-action", "_build_args"] context = "." contexts = { wget = "target:wget", @@ -89,7 +92,6 @@ target "tensorrt" { rootfs = "target:rootfs" } target = "frigate-tensorrt" - inherits = ["_build_args"] } target "devcontainer-trt" {