forked from openshift/windows-machine-config-bootstrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.tools
56 lines (43 loc) · 2.19 KB
/
Dockerfile.tools
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM docker.io/openshift/origin-release:golang-1.16 as build
LABEL stage=build
# Clone WMCO repo and initialize submodules for building of windows binaries payload for e2e testing
WORKDIR /build/
RUN git clone --branch release-4.8 --single-branch https://github.com/openshift/windows-machine-config-operator.git
WORKDIR /build/windows-machine-config-operator/
RUN git submodule update --init containernetworking-plugins kubelet ovn-kubernetes
# Build kubelet.exe
WORKDIR /build/windows-machine-config-operator/kubelet/
RUN KUBE_BUILD_PLATFORMS=windows/amd64 make WHAT=cmd/kubelet
# Build hybrid-overlay-node.exe
WORKDIR /build/windows-machine-config-operator/ovn-kubernetes/go-controller/
RUN make windows
# Build CNI plugins
WORKDIR /build/windows-machine-config-operator/containernetworking-plugins/
ENV CGO_ENABLED=0
RUN ./build_windows.sh
WORKDIR /build/
COPY . .
# Build WMCB unit and e2e tests
RUN make build-wmcb-unit-test
RUN make build-wmcb-e2e-test
# Build TestWMCB binary to run the tests on the Windows VM created
WORKDIR /build/internal/test/wmcb/
RUN CGO_ENABLED=0 GO111MODULE=on go test -c -run=TestWMCB -timeout=30m . -o test-wmcb
FROM docker.io/openshift/origin-release:golang-1.16 as testing
LABEL stage=testing
WORKDIR /payload/cni
COPY --from=build /build/windows-machine-config-operator/containernetworking-plugins/bin/flannel.exe .
COPY --from=build /build/windows-machine-config-operator/containernetworking-plugins/bin/host-local.exe .
COPY --from=build /build/windows-machine-config-operator/containernetworking-plugins/bin/win-bridge.exe .
COPY --from=build /build/windows-machine-config-operator/containernetworking-plugins/bin/win-overlay.exe .
WORKDIR /payload
COPY internal/test/wmcb/powershell/ .
COPY --from=build /build/windows-machine-config-operator/ovn-kubernetes/go-controller/_output/go/bin/windows/hybrid-overlay-node.exe .
COPY --from=build /build/windows-machine-config-operator/kubelet/_output/local/bin/windows/amd64/kubelet.exe .
COPY --from=build /build/wmcb_unit_test.exe .
COPY --from=build /build/wmcb_e2e_test.exe .
WORKDIR /test
COPY internal/test/wmcb/templates templates
COPY --from=build /build/internal/test/wmcb/test-wmcb .
ENV PATH="${PATH}:/test"
ENTRYPOINT ["/bin/bash"]