-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 712 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (25 loc) · 712 Bytes
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
FROM golang:latest AS builder
ARG TARGETOS
ARG TARGETARCH
ENV GO111MODULE=on \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH} \
CGO_ENABLED=0
WORKDIR /build
# Cache modules
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN OS=${TARGETOS} ARCH=${TARGETARCH} make build
WORKDIR /dist
RUN cp /build/cortex-tenant ./cortex-tenant
RUN mkdir /data && cp /build/deploy/cortex-tenant.yml /data/cortex-tenant.yml
FROM scratch
COPY --chown=65534:0 --from=builder /dist /
COPY --chown=65534:0 --from=builder /data /data
USER 65534
WORKDIR /data
COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["/cortex-tenant"]
CMD ["-config", "/data/cortex-tenant.yml"]