Skip to content

pkg(containerd): windows static builds#218

Merged
crazy-max merged 1 commit intodocker:mainfrom
crazy-max:containerd-win-static
Jul 22, 2025
Merged

pkg(containerd): windows static builds#218
crazy-max merged 1 commit intodocker:mainfrom
crazy-max:containerd-win-static

Conversation

@crazy-max
Copy link
Copy Markdown
Member

No description provided.

@crazy-max crazy-max requested review from thaJeztah and vvoland June 16, 2025 07:38
@crazy-max crazy-max marked this pull request as ready for review June 16, 2025 07:38
@crazy-max crazy-max force-pushed the containerd-win-static branch from 93aaa4f to 4a5e573 Compare June 16, 2025 13:20
@crazy-max crazy-max force-pushed the containerd-win-static branch from 4a5e573 to 8ed293f Compare June 16, 2025 13:31
Comment thread docker-bake.hcl Outdated
Comment on lines +448 to +524
# https://github.com/containerd/containerd/blob/main/.github/workflows/ci.yml#L135-L137
containerd = ["linux/amd64", "linux/arm/v6", "linux/arm/v7", "linux/arm64", "linux/ppc64le", "linux/s390x", "windows/amd64", "windows/arm64", "windows/arm/v7"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do windows/arm64 builds actually work? ISTR we could only build the CLI, but that there's things missing in Windows to run arm containers (besides there not being any images for windows on arm).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to bring back the arm64 VM to check that but why would this not work if arm/v7 is supported? https://github.com/containerd/containerd/blob/2af24b5629859019a7201c59dda611d25d608e65/.github/workflows/ci.yml#L135-L137 🤔

I recall I was able to run containerd on Windows arm64 when I was working on moby/moby#43431 (comment)

Copy link
Copy Markdown
Member Author

@crazy-max crazy-max Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binaries can be downloaded from GHA summary if someone wants to check as well: https://github.com/docker/packaging/actions/runs/15682245818?pr=218#summary-44176814920

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, it works with HyperV but I don't have a Windows ARM64 machine to verify

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there are no ARM images for Windows?

docker buildx imagetools inspect mcr.microsoft.com/windows/servercore:ltsc2025
Name:      mcr.microsoft.com/windows/servercore:ltsc2025
MediaType: application/vnd.docker.distribution.manifest.list.v2+json
Digest:    sha256:4c8150b6fe78cac412f24690d250c97c29a8cf2b0f241be7e9330e7d93292305

Manifests:
  Name:       mcr.microsoft.com/windows/servercore:ltsc2025@sha256:4259fc6862a6cd94ccd8840c052be3fb9486ad7b05ecea3c5155b142c6439e60
  MediaType:  application/vnd.docker.distribution.manifest.v2+json
  Platform:   windows/amd64
  OSVersion:  10.0.26100.4349
  OSFeatures: win32k

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are doing cross-compilation for static builds

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, more looking that if we build daemons for windows/arm, then they are not very useful, as there's no image that can be used with them?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but that's not really our problem right? We still break the chicken vs egg situation on our side though.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to publish these, but at least having them available somewhere wouldn't hurt.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to bring back the arm64 VM to check

Works fine on arm64

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the containerd-win-static branch from 8ed293f to a36f0af Compare July 8, 2025 10:00
Comment thread pkg/containerd/Dockerfile
ARG PKG_REF
ARG RUNC_REPO
ARG RUNC_REF
ARG RUNHCS_REPO
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should create a tracking ticket to start documenting these build-args in the "godoc" ("dockerfile-doc"?) format, so that docker build --call=outline can describe them; e.g. output on docker/cli (not perfect; still needs some updates); shows;

docker build --progress=quiet --call=outline .

TARGET: binary

BUILD ARG               VALUE    DESCRIPTION
BASE_VARIANT            alpine
ALPINE_VERSION          3.21
GO_VERSION              1.24.4
XX_VERSION              1.6.1
GOVERSIONINFO_VERSION   v1.4.1
GO_LINKMODE             static   defines if static or dynamic binary should be produced
GO_BUILDTAGS                     defines additional build tags
GO_STRIP                         strips debugging symbols if set
CGO_ENABLED                      manually sets if cgo is used
VERSION                          sets the version for the produced binary
PACKAGER_NAME                    sets the company that produced the windows binary

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

@crazy-max crazy-max merged commit f236c73 into docker:main Jul 22, 2025
660 of 665 checks passed
@crazy-max crazy-max deleted the containerd-win-static branch July 22, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants