diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8d321e728..3ce3a5313d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -154,3 +154,23 @@ jobs: uses: github/codeql-action/upload-sarif@v3 with: 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 diff --git a/Dockerfile b/Dockerfile index 66a0855e74..dfd6fc2608 100644 --- a/Dockerfile +++ b/Dockerfile @@ -657,6 +657,15 @@ FROM dev-base AS devcontainer COPY --link . . 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: # > make shell # > SYSTEMD=true make shell diff --git a/docker-bake.hcl b/docker-bake.hcl index 9c7c33c8cd..195768e83a 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -164,6 +164,17 @@ target "bin-image-cross" { ] } +# +# dind +# + +target "dind" { + inherits = ["_common"] + target = "dind" + tags = ["docker-dind"] + output = ["type=docker"] +} + # # dev #