diff --git a/deploy/Dockerfile.multi b/deploy/Dockerfile.multi new file mode 100644 index 00000000..a3daca89 --- /dev/null +++ b/deploy/Dockerfile.multi @@ -0,0 +1,34 @@ +FROM --platform=$BUILDPLATFORM golang:1.14 AS build-env +ARG TARGETPLATFORM +ARG BUILDPLATFORM +ARG BUILDARCH +ARG TARGETARCH + +ADD . /src/github.com/AliyunContainerService/kube-eventer +ENV GOPATH /:/src/github.com/AliyunContainerService/kube-eventer/vendor +ENV GO111MODULE on +ENV GOPROXY=https://goproxy.cn,direct +WORKDIR /src/github.com/AliyunContainerService/kube-eventer +RUN apt-get update -y && apt-get install gcc ca-certificates + +RUN echo "I am running on $BUILDPLATFORM $BUILDARCH, building for $TARGETPLATFORM $TARGETARCH" + +RUN make ARCH=$TARGETARCH + + +FROM alpine:3.11.6 +LABEL maintainer="KeyOfSpectator " + +COPY --from=build-env /src/github.com/AliyunContainerService/kube-eventer/kube-eventer / +COPY --from=build-env /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + +ENV TZ "Asia/Shanghai" +RUN apk add --no-cache tzdata +#COPY deploy/entrypoint.sh / +RUN addgroup -g 1000 nonroot && \ + adduser -u 1000 -D -H -G nonroot nonroot && \ + chown -R nonroot:nonroot /kube-eventer +USER nonroot:nonroot + +ENTRYPOINT ["/kube-eventer"] +