forked from aws/amazon-ec2-metadata-mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.windows
31 lines (26 loc) · 878 Bytes
/
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
ARG WINDOWS_VERSION=1809
# Build the manager binary
FROM golang:1.17 as builder
# GOLANG env
ARG GOPROXY="https://proxy.golang.org|direct"
ARG GO111MODULE="on"
ARG CGO_ENABLED=0
ARG GOOS=windows
ARG GOARCH=amd64
# Copy go.mod and download dependencies
WORKDIR /amazon-ec2-metadata-mock
COPY go.mod .
COPY go.sum .
RUN go mod download
# Build
COPY . .
RUN go build -a -tags aemm-windows -o ./build/ec2-metadata-mock.exe ./cmd/amazon-ec2-metadata-mock.go
# In case the target is build for testing:
# $ docker build --target=builder -t test .
ENTRYPOINT ["/amazon-ec2-metadata-mock/build/ec2-metadata-mock.exe"]
# Copy the controller-manager into a thin image
FROM mcr.microsoft.com/windows/nanoserver:${WINDOWS_VERSION}
WORKDIR /
COPY --from=builder /amazon-ec2-metadata-mock/build/ec2-metadata-mock.exe .
COPY THIRD_PARTY_LICENSES.md .
ENTRYPOINT ["/ec2-metadata-mock.exe"]