Dockerfile: add "all" stage to build binaries and extra tools

We still need a stage that build binaries and extra tools as well for
docker-ce-packaging repo: ff110508ff/static/Makefile (L41-L57)

This could be removed if we create a package for each project
like it's done in docker-packaging repo: https://github.com/docker/packaging/tree/main/pkg

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-12-29 15:35:55 +01:00
parent 113e95ec02
commit e8a82ed24d
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
3 changed files with 26 additions and 1 deletions

View file

@ -110,7 +110,7 @@ jobs:
name: Build
uses: docker/bake-action@v2
with:
targets: binary
targets: all
set: |
*.platform=${{ matrix.platform }}
-

View file

@ -597,6 +597,17 @@ EOT
FROM scratch AS binary
COPY --from=build /build/ /
# usage:
# > docker buildx bake all
FROM scratch AS all
COPY --from=tini /build/ /
COPY --from=runc /build/ /
COPY --from=containerd /build/ /
COPY --from=rootlesskit /build/ /
COPY --from=containerutil /build/ /
COPY --from=vpnkit / /
COPY --from=build /build /
# usage:
# > make shell
# > SYSTEMD=true make shell

View file

@ -124,6 +124,20 @@ target "binary-cross" {
inherits = ["binary", "_platforms"]
}
#
# same as binary but with extra tools as well (containerd, runc, ...)
#
target "all" {
inherits = ["_common"]
target = "all"
output = [bindir(DOCKER_STATIC == "1" ? "binary" : "dynbinary")]
}
target "all-cross" {
inherits = ["all", "_platforms"]
}
#
# dev
#