-
Notifications
You must be signed in to change notification settings - Fork 422
/
Dockerfile
41 lines (33 loc) · 913 Bytes
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
ARG BUILDPLATFORM=linux/amd64
ARG BUILD_BASE_IMAGE
ARG BINARY_BASE_IMAGE
FROM --platform=$BUILDPLATFORM $BUILD_BASE_IMAGE AS build
WORKDIR /azure
COPY go.mod go.sum /azure/
RUN go mod download
RUN apt-get update
RUN apt-get install -y ca-certificates openssl
ARG TARGETOS
ARG TARGETARCH
ARG BUILD_TAG
ARG BUILD_DATE
ARG GIT_HASH
COPY cmd cmd
COPY pkg pkg
COPY Makefile Makefile
RUN make build \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH} \
BUILD_TAG=${BUILD_TAG} \
BUILD_DATE=${BUILD_DATE} \
GIT_HASH=${GIT_HASH}
#RUN ldd ./bin/appgw-ingress 2>&1 | grep 'not a dynamic executable'
FROM $BINARY_BASE_IMAGE AS final
COPY --from=build /azure/bin/appgw-ingress /appgw-ingress
RUN apt-get update
RUN apt-get install -y ca-certificates openssl
RUN useradd appgw-ingress-user
RUN chown appgw-ingress-user /appgw-ingress
USER appgw-ingress-user
RUN chmod +x /appgw-ingress
CMD ["/appgw-ingress"]