From ff00246afd7e03730ce4ee55083820cc451a9f7a Mon Sep 17 00:00:00 2001 From: ttionya Date: Sun, 17 Nov 2024 17:03:25 +0800 Subject: [PATCH] chore: optimize docker-bake file --- docker-bake.hcl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docker-bake.hcl b/docker-bake.hcl index c9eaf9c..0eb5b87 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -12,12 +12,18 @@ target "_common" { inherits = ["docker-metadata-action"] context = "." dockerfile = "Dockerfile" +} + +target "_common_multi_platforms" { platforms = [ "linux/amd64", "linux/arm64", "linux/arm/v6", "linux/arm/v7" ] +} + +target "_common_tags" { tags = [ "ttionya/vaultwarden-backup:latest", "ttionya/vaultwarden-backup:${VERSION}", @@ -29,7 +35,7 @@ target "_common" { } target "image-stable" { - inherits = ["_common"] + inherits = ["_common", "_common_multi_platforms", "_common_tags"] } target "image-schedule" { @@ -37,14 +43,14 @@ target "image-schedule" { } target "image-beta" { - inherits = ["_common"] + inherits = ["_common", "_common_multi_platforms"] tags = [ "ttionya/vaultwarden-backup:${VERSION}" ] } target "image-test-base" { - inherits = ["_common"] + inherits = ["_common", "_common_multi_platforms"] tags = [ "${TEST_BASE_TAG}" ] @@ -53,9 +59,6 @@ target "image-test-base" { target "image-test" { inherits = ["_common"] dockerfile = "./tests/Dockerfile" - platforms = [ - "linux/amd64" - ] contexts = { base = "docker-image://${TEST_BASE_TAG}" }