-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathDockerfile.windows
39 lines (38 loc) · 1.2 KB
/
Dockerfile.windows
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
ARG BCI_IMAGE=registry.suse.com/bci/bci-base
ARG GO_IMAGE=rancher/hardened-build-base:v1.23.3b1
FROM ${BCI_IMAGE} as bci
FROM ${GO_IMAGE} as builder
ARG ARCH="amd64"
ARG GOOS="windows"
# setup required packages
RUN set -x && \
apk --no-cache add \
btrfs-progs-dev \
btrfs-progs-static \
file \
gcc \
git \
libselinux-dev \
libseccomp-dev \
libseccomp-static \
make \
mercurial \
subversion \
mingw-w64-gcc \
unzip
RUN curl -LO https://github.com/google/protobuf/releases/download/v3.17.3/protoc-3.17.3-linux-x86_64.zip; \
unzip protoc-3.17.3-linux-x86_64.zip -d /usr;
# setup containerd build
ARG SRC="github.com/k3s-io/containerd"
ARG PKG="github.com/containerd/containerd"
ARG TAG="v2.0.2-k3s1"
RUN git clone --depth=1 https://${SRC}.git ${GOPATH}/src/${PKG}
WORKDIR $GOPATH/src/${PKG}
RUN git fetch --tags --depth=1 origin ${TAG}
RUN git checkout tags/${TAG} -b ${TAG}
RUN export CGO_ENABLED=1 CXX=x86_64-w64-mingw32-g++ CC=x86_64-w64-mingw32-gcc && \
make binaries GOOS=windows VERSION=${TAG} && \
install -s bin/* /usr/local/bin && \
strings /usr/local/bin/containerd.exe | grep -F "${TAG}"
FROM bci
COPY --from=builder /usr/local/bin/ /usr/local/bin/