-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from AliyunContainerService/features/multi-pl…
…atform-20211028 Features/multi platform 20211028
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <shichun.fsc@alibaba-inc.com>" | ||
|
||
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"] | ||
|