dockerfile: dind target to build docker image for testing

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2025-03-13 14:29:30 +01:00
parent 9ba5c5d70e
commit f410dbda88
3 changed files with 40 additions and 0 deletions

View File

@@ -154,3 +154,23 @@ jobs:
uses: github/codeql-action/upload-sarif@v3 uses: github/codeql-action/upload-sarif@v3
with: with:
sarif_file: ${{ env.DESTDIR }}/govulncheck.out sarif_file: ${{ env.DESTDIR }}/govulncheck.out
build-dind:
runs-on: ubuntu-24.04
needs:
- validate-dco
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Build dind image
uses: docker/bake-action@v6
with:
targets: dind
set: |
*.output=type=cacheonly

View File

@@ -657,6 +657,15 @@ FROM dev-base AS devcontainer
COPY --link . . COPY --link . .
COPY --link --from=gopls /build/ /usr/local/bin/ COPY --link --from=gopls /build/ /usr/local/bin/
# usage:
# > docker buildx bake dind
# > docker run -d --restart always --privileged --name devdind -p 12375:2375 docker-dind --debug --host=tcp://0.0.0.0:2375 --tlsverify=false
FROM docker:dind AS dind
COPY --link --from=dockercli /build/docker /usr/local/bin/
COPY --link --from=buildx /buildx /usr/local/libexec/docker/cli-plugins/docker-buildx
COPY --link --from=compose /docker-compose /usr/local/libexec/docker/cli-plugins/docker-compose
COPY --link --from=all / /usr/local/bin/
# usage: # usage:
# > make shell # > make shell
# > SYSTEMD=true make shell # > SYSTEMD=true make shell

View File

@@ -164,6 +164,17 @@ target "bin-image-cross" {
] ]
} }
#
# dind
#
target "dind" {
inherits = ["_common"]
target = "dind"
tags = ["docker-dind"]
output = ["type=docker"]
}
# #
# dev # dev
# #