From a146ea36bdd987d6055c0853a07742bbb6e86252 Mon Sep 17 00:00:00 2001 From: Elio Bischof Date: Tue, 17 Jun 2025 15:18:56 +0200 Subject: [PATCH] inline --- .github/workflows/test.yml | 3 +++ docker-bake-ci.hcl | 31 +++++++++++++++++++++++++++++++ docker-bake.hcl | 33 ++++++++++++--------------------- 3 files changed, 46 insertions(+), 21 deletions(-) create mode 100644 docker-bake-ci.hcl diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea39b5f4c3..1a135f4c00 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,5 +45,8 @@ jobs: provenance: false load: true pull: true + files: | + docker-bake.hcl + docker-bake-ci.hcl - run: ls -la if: always() diff --git a/docker-bake-ci.hcl b/docker-bake-ci.hcl new file mode 100644 index 0000000000..d920c091c9 --- /dev/null +++ b/docker-bake-ci.hcl @@ -0,0 +1,31 @@ +target "docker-metadata-action" {} + +target "login-pnpm" { + cache-to = [ + { "type": "inline"}, + { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}", "mode": "max" } + ] + output = [ + { "type" : "image", "name": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}", push: true }, + ] +} + +target "login-dev-base" { + cache-to = [ + { "type": "inline"}, + { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}", "mode": "max" } + ] + output = [ + { "type" : "image", "name": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}", push: true }, + ] +} + +target "login-lint" { + cache-to = [ + { "type": "inline"}, + { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}", "mode": "max" } + ] + output = [ + { "type" : "image", "name": "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}", push: true }, + ] +} diff --git a/docker-bake.hcl b/docker-bake.hcl index 95727ef035..9e72e47bc5 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -9,45 +9,36 @@ variable "BUILD_CACHE_KEY" { } target "login-pnpm" { - context = "." - dockerfile = "dockerfiles/login-pnpm.Dockerfile" cache-from = [ { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:latest" }, { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}" } ] - cache-to = [ - { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-pnpm-buildcache:${BUILD_CACHE_KEY}", "mode": "max" } - ] + dockerfile = "dockerfiles/login-pnpm.Dockerfile" + context = "." } target "login-dev-base" { - context = "." - dockerfile = "dockerfiles/login-dev-base.Dockerfile" - contexts = { - login-pnpm = "target:login-pnpm" - } cache-from = [ {"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:latest"}, {"type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}"} ] - cache-to = [ - { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-dev-base-buildcache:${BUILD_CACHE_KEY}", "mode": "max" } - ] + dockerfile = "dockerfiles/login-dev-base.Dockerfile" + context = "." + contexts = { + login-pnpm = "target:login-pnpm" + } } target "login-lint" { - context = "." - dockerfile = "dockerfiles/login-lint.Dockerfile" - contexts = { - login-dev-base = "target:login-dev-base" - } cache-from = [ {"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:latest"}, {"type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}"} ] - cache-to = [ - { "type": "registry", "ref": "${IMAGE_REGISTRY}/login-lint-buildcache:${BUILD_CACHE_KEY}", "mode": "max" } - ] + dockerfile = "dockerfiles/login-lint.Dockerfile" + context = "." + contexts = { + login-dev-base = "target:login-dev-base" + } } variable "LOGIN_TEST_UNIT_TAG" {