-
Notifications
You must be signed in to change notification settings - Fork 0
/
multi_arch_Dockerfile
28 lines (23 loc) · 997 Bytes
/
multi_arch_Dockerfile
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
# Build the manager binary
FROM --platform=$BUILDPLATFORM golang:1.18 as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG BUILDARCH
ARG TARGETARCH
ENV GOPROXY=https://goproxy.cn,direct
# Copy in the go src
WORKDIR /go/src/github.com/AliyunContainerService/kubernetes-cronhpa-controller
COPY pkg/ pkg/
COPY cmd/ cmd/
COPY vendor/ vendor/
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH GO111MODULE=off go build -a -o kubernetes-cronhpa-controller github.com/AliyunContainerService/kubernetes-cronhpa-controller/cmd/kubernetes-cronhpa-controller
# Copy the controller-manager into a thin image
FROM registry.cn-hangzhou.aliyuncs.com/acs/alpine:3.13-update
RUN apk add --no-cache tzdata
WORKDIR /root/
COPY --from=builder /go/src/github.com/AliyunContainerService/kubernetes-cronhpa-controller/kubernetes-cronhpa-controller .
COPY docker-entrypoint.sh .
RUN chmod +x /root/docker-entrypoint.sh
ENTRYPOINT ["/root/docker-entrypoint.sh"]
CMD ["/root/kubernetes-cronhpa-controller"]