From bf35764d1da9c74ff183e7aa20aa9e56d7ac2ca3 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:47:36 +0100 Subject: [PATCH] chore: put context keep dir within the bake definition Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- .github/workflows/validate.yml | 2 -- docker-bake.hcl | 13 +++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index f2c96c8..4afd4c9 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -41,5 +41,3 @@ jobs: uses: docker/bake-action@v6 with: targets: ${{ matrix.target }} - set: | - *.args.BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 diff --git a/docker-bake.hcl b/docker-bake.hcl index 0cb454a..071ae16 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,3 +1,9 @@ +target "_common" { + args = { + BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 + } +} + group "default" { targets = ["build"] } @@ -11,42 +17,49 @@ group "validate" { } target "build" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "build-update" output = ["."] } target "build-validate" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "build-validate" output = ["type=cacheonly"] } target "format" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "format-update" output = ["."] } target "lint" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "lint" output = ["type=cacheonly"] } target "vendor" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "vendor-update" output = ["."] } target "vendor-validate" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "vendor-validate" output = ["type=cacheonly"] } target "test" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "test-coverage" output = ["./coverage"]