diff --git a/.github/workflows/buildkit.yml b/.github/workflows/buildkit.yml index baa27a7757..d131d9c9ba 100644 --- a/.github/workflows/buildkit.yml +++ b/.github/workflows/buildkit.yml @@ -13,7 +13,7 @@ on: pull_request: env: - BUNDLES_OUTPUT: ./bundles + DESTDIR: ./build jobs: validate-dco: @@ -40,7 +40,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: binary - path: ${{ env.BUNDLES_OUTPUT }} + path: ${{ env.DESTDIR }} if-no-files-found: error retention-days: 1 @@ -106,7 +106,7 @@ jobs: env: CONTEXT: "." TEST_DOCKERD: "1" - TEST_DOCKERD_BINARY: "./build/moby/binary-daemon/dockerd" + TEST_DOCKERD_BINARY: "./build/moby/dockerd" TESTPKGS: "./${{ matrix.pkg }}" TESTFLAGS: "-v --parallel=1 --timeout=30m --run=//worker=dockerd$" working-directory: buildkit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a34abc2425..97ee4e73b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ on: pull_request: env: - BUNDLES_OUTPUT: ./bundles + DESTDIR: ./build jobs: validate-dco: @@ -50,7 +50,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: ${{ matrix.target }} - path: ${{ env.BUNDLES_OUTPUT }} + path: ${{ env.DESTDIR }} if-no-files-found: error retention-days: 7 @@ -110,6 +110,6 @@ jobs: uses: actions/upload-artifact@v3 with: name: cross-${{ env.PLATFORM_PAIR }} - path: ${{ env.BUNDLES_OUTPUT }} + path: ${{ env.DESTDIR }} if-no-files-found: error retention-days: 7 diff --git a/docker-bake.hcl b/docker-bake.hcl index e46a64a9a6..4cfc01eced 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,10 +1,16 @@ -variable "BUNDLES_OUTPUT" { - default = "./bundles" -} variable "DOCKER_STATIC" { default = "1" } +# Defines the output folder +variable "DESTDIR" { + default = "" +} +function "bindir" { + params = [defaultdir] + result = DESTDIR != "" ? DESTDIR : "./bundles/${defaultdir}" +} + target "_common" { args = { BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 @@ -37,11 +43,12 @@ target "_platforms" { target "binary" { inherits = ["_common"] target = "binary" - output = [BUNDLES_OUTPUT] + output = [bindir(DOCKER_STATIC == "1" ? "binary" : "dynbinary")] } target "dynbinary" { inherits = ["binary"] + output = [bindir("dynbinary")] args = { DOCKER_STATIC = "0" }