forked from cuelang/cue
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (27 loc) · 738 Bytes
/
Dockerfile
File metadata and controls
28 lines (27 loc) · 738 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
# target: cue-builder
ARG GOLANG_VERSION
FROM docker.io/golang:${GOLANG_VERSION}-alpine AS cue-builder
ARG CUE_VERSION
ENV \
OUTDIR='/out' \
GO111MODULE='on'
RUN set -eux && \
apk add --no-cache \
git
WORKDIR /go/src/cuelang.org/go
COPY go.mod /go/src/cuelang.org/go/
COPY go.sum /go/src/cuelang.org/go/
RUN set -eux && \
go mod download
COPY . /go/src/cuelang.org/go/
RUN set -eux && \
CGO_ENABLED=0 GOBIN=${OUTDIR}/usr/bin/ go install \
-a -v \
-tags='osusergo,netgo' \
-installsuffix='netgo' \
-ldflags="-s -w -X cuelang.org/go/cmd/cue/cmd.version=${CUE_VERSION} \"-extldflags=-static\"" \
./cmd/cue
# target: cue
FROM gcr.io/distroless/static:latest AS cue
COPY --from=cue-builder /out/ /
ENTRYPOINT ["/usr/bin/cue"]