forked from skai-x/elastic-jupyter-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (24 loc) · 868 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
# Build the elastic-jupyter-operator binary
FROM golang:1.17.6-alpine as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# Download libs first to use docker buildx caching
RUN go mod download
RUN go mod verify
# Copy the go source
COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/
COPY pkg/ pkg/
# Build
RUN CGO_ENABLED=0 go build -a -o elastic-jupyter-operator main.go
# Use distroless as minimal base image to package the elastic-jupyter-operator binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
LABEL org.opencontainers.image.source https://github.com/tkestack/elastic-jupyter-operator
WORKDIR /
COPY --from=builder /workspace/elastic-jupyter-operator .
USER nonroot:nonroot
ENTRYPOINT ["/elastic-jupyter-operator"]