build: export dependencies for native integration tests

The Debian development image supplies the Go toolchain, runtime binaries,
test reporter, and frozen images. Even the VM jobs run inside that image,
so these dependencies have not needed to be installed on the guest.

Add a scratch export target that reuses the existing pinned build stages.
Native tests can then compile the daemon and tests against the guest's
userspace while retaining the same tools and fixtures. Export static
runtime binaries so they also work on older guest distributions.

Assisted-by: Codex
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda committed 2026-09-15 14:03:22 +09:00
1 parent fc44b26e58
commit 98164696aa
2 files changed
+24

No files matched your search

+14
View File
@@ -615,6 +615,20 @@ COPY --link --from=rootlesskit /build/ /
COPY --link --from=containerutil /build/ /
COPY --link --from=build /build /
# Tools and fixtures for running integration tests directly on a Linux host.
# Build this for the host architecture; the Go toolchain and gotestsum run there.
# The daemon and tests are compiled on the host by hack/make.sh.
FROM scratch AS test-integration-deps
COPY --link --from=base /usr/local/go/ /usr/local/go/
COPY --link --from=tini /build/ /usr/local/bin/
COPY --link --from=runc /build/ /usr/local/bin/
COPY --link --from=containerd /build/ /usr/local/bin/
COPY --link --from=rootlesskit /build/ /usr/local/bin/
COPY --link --from=dockercli /build/ /usr/local/bin/
COPY --link --from=gotestsum /build/ /usr/local/bin/
COPY --link --from=registry /build/ /usr/local/bin/
COPY --link --from=frozen-images /build/ /docker-frozen-images/
# smoke tests
# usage:
# > docker buildx bake binary-smoketest
+10
View File
@@ -141,6 +141,16 @@ target "all-cross" {
inherits = ["all", "_platforms"]
}
# Export the pinned tools and fixtures for integration tests on a Linux host.
target "test-integration-deps" {
inherits = ["_common"]
target = "test-integration-deps"
args = {
DOCKER_STATIC = "1"
}
output = [bindir("test-integration-deps")]
}
#
# bin image
#