-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (43 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
56 lines (43 loc) · 1.27 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM --platform=$BUILDPLATFORM GO_BUILD_IMG AS builder
ARG AUTHOR=Layer7
ARG VENDOR="Broadcom Inc."
ARG TITLE
ARG VERSION
ARG CREATED
ARG COPYRIGHT
LABEL org.opencontainers.image.created=${CREATED}
LABEL org.opencontainers.image.authors=${AUTHOR}
LABEL org.opencontainers.image.title=${TITLE}
LABEL org.opencontainers.image.version=${VERSION}
LABEL org.opencontainers.image.vendor=${VENDOR}
LABEL com.broadcom.copyright=${COPYRIGHT}
ARG GOPROXY
WORKDIR /workspace
COPY go.mod go.mod
COPY go.sum go.sum
COPY internal/ internal/
COPY cmd/main.go cmd/main.go
COPY api/ api/
COPY pkg/ pkg/
COPY scripts/ scripts/
ENV GOPROXY=${GOPROXY}
RUN go mod download
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on go build -a -o manager cmd/main.go
FROM DISTROLESS_IMG
ARG AUTHOR=Layer7
ARG VENDOR="Broadcom Inc."
ARG TITLE
ARG VERSION
ARG CREATED
ARG COPYRIGHT
LABEL org.opencontainers.image.created=${CREATED}
LABEL org.opencontainers.image.authors=${AUTHOR}
LABEL org.opencontainers.image.title=${TITLE}
LABEL org.opencontainers.image.version=${VERSION}
LABEL org.opencontainers.image.vendor=${VENDOR}
LABEL com.broadcom.copyright=${COPYRIGHT}
WORKDIR /
COPY --from=builder /workspace/scripts .
COPY --from=builder /workspace/manager .
USER 65532:65532
ENTRYPOINT ["/manager"]