Add labels to labels?

This commit is contained in:
Gavin Mogan 2025-09-05 21:43:44 -07:00
parent 962cde3446
commit 89b794705a
6 changed files with 32 additions and 8 deletions

View File

@ -8,6 +8,8 @@ outputs:
value: ${{ steps.meta.outputs.tags }} value: ${{ steps.meta.outputs.tags }}
image-labels: image-labels:
value: ${{ steps.meta.outputs.labels }} value: ${{ steps.meta.outputs.labels }}
bake-file:
value: ${{ steps.meta.outputs.bake-file }}
cache-name: cache-name:
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:cache value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:cache
runs: runs:
@ -54,6 +56,7 @@ runs:
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
bake-target: docker-metadata-action
# list of Docker images to use as base name for tags # list of Docker images to use as base name for tags
images: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }} images: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}
tags: type=raw,value=${{ steps.create-short-sha.outputs.SHORT_SHA }} tags: type=raw,value=${{ steps.create-short-sha.outputs.SHORT_SHA }}

View File

@ -73,7 +73,9 @@ jobs:
source: . source: .
push: true push: true
targets: rpi targets: rpi
files: docker/rpi/rpi.hcl files: |
docker/rpi/rpi.hcl
${{ steps.setup.outputs.bake-file }}
set: | set: |
rpi.tags=${{ steps.setup.outputs.image-name }}-rpi rpi.tags=${{ steps.setup.outputs.image-name }}-rpi
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64 *.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64
@ -102,7 +104,9 @@ jobs:
source: . source: .
push: true push: true
targets: tensorrt targets: tensorrt
files: docker/tensorrt/trt.hcl files: |
docker/tensorrt/trt.hcl
${{ steps.setup.outputs.bake-file }}
set: | set: |
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt-jp6 tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt-jp6
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp6 *.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp6
@ -130,7 +134,9 @@ jobs:
source: . source: .
push: true push: true
targets: tensorrt targets: tensorrt
files: docker/tensorrt/trt.hcl files: |
docker/tensorrt/trt.hcl
${{ steps.setup.outputs.bake-file }}
set: | set: |
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt *.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt
@ -144,7 +150,9 @@ jobs:
source: . source: .
push: true push: true
targets: rocm targets: rocm
files: docker/rocm/rocm.hcl files: |
docker/rocm/rocm.hcl
${{ steps.setup.outputs.bake-file }}
set: | set: |
rocm.tags=${{ steps.setup.outputs.image-name }}-rocm rocm.tags=${{ steps.setup.outputs.image-name }}-rocm
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rocm,mode=max *.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rocm,mode=max
@ -170,7 +178,9 @@ jobs:
source: . source: .
push: true push: true
targets: rk targets: rk
files: docker/rockchip/rk.hcl files: |
docker/rockchip/rk.hcl
${{ steps.setup.outputs.bake-file }}
set: | set: |
rk.tags=${{ steps.setup.outputs.image-name }}-rk rk.tags=${{ steps.setup.outputs.image-name }}-rk
*.cache-from=type=gha *.cache-from=type=gha

View File

@ -1,3 +1,5 @@
target "docker-metadata-action" {}
target wheels { target wheels {
dockerfile = "docker/main/Dockerfile" dockerfile = "docker/main/Dockerfile"
platforms = ["linux/arm64"] platforms = ["linux/arm64"]
@ -18,10 +20,11 @@ target rootfs {
target rk { target rk {
dockerfile = "docker/rockchip/Dockerfile" dockerfile = "docker/rockchip/Dockerfile"
inherits = ["docker-metadata-action"]
contexts = { contexts = {
wheels = "target:wheels", wheels = "target:wheels",
deps = "target:deps", deps = "target:deps",
rootfs = "target:rootfs" rootfs = "target:rootfs"
} }
platforms = ["linux/arm64"] platforms = ["linux/arm64"]
} }

View File

@ -11,6 +11,8 @@ variable "HSA_OVERRIDE" {
default = "1" default = "1"
} }
target "docker-metadata-action" {}
target wget { target wget {
dockerfile = "docker/main/Dockerfile" dockerfile = "docker/main/Dockerfile"
platforms = ["linux/amd64"] platforms = ["linux/amd64"]
@ -31,6 +33,7 @@ target rootfs {
target rocm { target rocm {
dockerfile = "docker/rocm/Dockerfile" dockerfile = "docker/rocm/Dockerfile"
inherits = ["docker-metadata-action"]
contexts = { contexts = {
deps = "target:deps", deps = "target:deps",
wget = "target:wget", wget = "target:wget",

View File

@ -1,3 +1,5 @@
target "docker-metadata-action" {}
target deps { target deps {
dockerfile = "docker/main/Dockerfile" dockerfile = "docker/main/Dockerfile"
platforms = ["linux/arm64"] platforms = ["linux/arm64"]
@ -12,9 +14,10 @@ target rootfs {
target rpi { target rpi {
dockerfile = "docker/rpi/Dockerfile" dockerfile = "docker/rpi/Dockerfile"
inherits = ["docker-metadata-action"]
contexts = { contexts = {
deps = "target:deps", deps = "target:deps",
rootfs = "target:rootfs" rootfs = "target:rootfs"
} }
platforms = ["linux/arm64"] platforms = ["linux/arm64"]
} }

View File

@ -29,6 +29,8 @@ fi
EOT EOT
} }
target "docker-metadata-action" {}
target "_build_args" { target "_build_args" {
args = { args = {
BASE_IMAGE = BASE_IMAGE, BASE_IMAGE = BASE_IMAGE,
@ -81,6 +83,7 @@ target "trt-deps" {
target "tensorrt" { target "tensorrt" {
dockerfile = "docker/tensorrt/Dockerfile.${ARCH}" dockerfile = "docker/tensorrt/Dockerfile.${ARCH}"
inherits = ["docker-metadata-action", "_build_args"]
context = "." context = "."
contexts = { contexts = {
wget = "target:wget", wget = "target:wget",
@ -89,7 +92,6 @@ target "tensorrt" {
rootfs = "target:rootfs" rootfs = "target:rootfs"
} }
target = "frigate-tensorrt" target = "frigate-tensorrt"
inherits = ["_build_args"]
} }
target "devcontainer-trt" { target "devcontainer-trt" {