Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Building for Windows #560

Closed
darstahl opened this issue Jan 20, 2018 · 2 comments
Closed

Building for Windows #560

darstahl opened this issue Jan 20, 2018 · 2 comments

Comments

@darstahl
Copy link

darstahl commented Jan 20, 2018

As containerd windows support is incomming we should start looking forward to get cri-containerd to use this. The first step is to get it to build on Windows. Based on a quick view through the code, I don't see any major blockers, but a number of libraries used do not build on Windows, and would the code needs to be refactored such that these are in Linux only files (though any Spec generation for Linux containers needs to be kept on both platforms to support Linux containers on Windows (LCOW).

Vendoring does not pull any packages that fail to download on Windows (such as filenames that contain :), which is great!

The build can be performed via cross-compile (as below), or built with mingw32-make.exe on Windows for now, and as with Docker, we can eventually transition to a powershell based build (or other Windows style build) in time in order to lower the barrier of entry to Windows developers.

Initial errors in build are coming from Linux only packages apparmor, seccomp and selinux, but I haven't taken the time to dig and see what the next error is from (I'm sure there will be more).

darren@darst-dev:~/go/src/github.com/containerd/cri-containerd$ export GOOS=windows
darren@darst-dev:~/go/src/github.com/containerd/cri-containerd$ make
go build -o _output/cri-containerd \
        -tags 'seccomp apparmor' \
        -ldflags '-X github.com/containerd/cri-containerd/pkg/version.CRIContainerdVersion=1.0.0-beta.1-38-g9449892' \
        -gcflags '' \
        github.com/containerd/cri-containerd/cmd/cri-containerd
pkg/server/container_create.go:28:2: no buildable Go source files in /home/darren/go/src/github.com/containerd/cri-containerd/vendor/github.com/containerd/containerd/contrib/apparmor
pkg/server/container_create.go:29:2: no buildable Go source files in /home/darren/go/src/github.com/containerd/cri-containerd/vendor/github.com/containerd/containerd/contrib/seccomp
pkg/server/helpers.go:35:2: no buildable Go source files in /home/darren/go/src/github.com/containerd/cri-containerd/vendor/github.com/opencontainers/selinux/go-selinux
Makefile:83: recipe for target '_output/cri-containerd' failed
make: *** [_output/cri-containerd] Error 1

I can start to take a look at this some time next week, but if anyone wants to tackle it ahead of that, it would be great!

@abhi @dmcgowan @stevvooe @crosbymichael @jhowardmsft

@Random-Liu
Copy link
Member

Random-Liu commented Jan 25, 2018

@darrenstahlmsft Thanks for filing the issue. :)

We'd like to help making cri-containerd work on Windows. It may not be a top priority this quarter, but it will be high priority very soon I believe.

@rgl
Copy link

rgl commented Mar 8, 2022

@dmcgowan can you please share why this issue was closed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants