This commit is contained in:
Gavin Mogan 2025-10-26 12:09:43 +10:00 committed by GitHub
commit d32e3a93b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 52 additions and 12 deletions

View File

@ -5,7 +5,11 @@ inputs:
required: true
outputs:
image-name:
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ steps.create-short-sha.outputs.SHORT_SHA }}
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:
@ -48,3 +52,11 @@ runs:
- id: create-short-sha
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
shell: bash
- name: Docker meta
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 }}

View File

@ -39,6 +39,7 @@ jobs:
push: true
platforms: linux/amd64
target: frigate
labels: ${{ steps.setup.outputs.image-labels }}
tags: ${{ steps.setup.outputs.image-name }}-amd64
cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64
cache-to: type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64,mode=max
@ -63,8 +64,8 @@ jobs:
push: true
platforms: linux/arm64
target: frigate
tags: |
${{ steps.setup.outputs.image-name }}-standard-arm64
labels: ${{ steps.setup.outputs.image-labels }}
tags: ${{ steps.setup.outputs.image-name }}-standard-arm64
cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64
- name: Build and push RPi build
uses: docker/bake-action@v6
@ -72,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
@ -101,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
@ -129,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
@ -143,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
@ -169,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
@ -219,9 +230,15 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create short sha
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
- uses: docker/metadata-action@v5
id: metadata
with:
images: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}
tags: type=raw,value=${{ env.SHORT_SHA }}
- uses: int128/docker-manifest-create-action@v2
with:
tags: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}
index-annotations: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.metadata.outputs.tags }}
sources: |
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}-amd64
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}-rpi

View File

@ -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"]
}
}

View File

@ -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",

View File

@ -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"]
}
}

View File

@ -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" {