This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
forked from cue-lang/cue
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: add Dockerfile and .dockerignore
Change-Id: I81b491e66a81c5b66c1561a9484434267e9b544d Reviewed-on: https://cue-review.googlesource.com/c/cue/+/5140 Reviewed-by: Marcel van Lohuizen <[email protected]>
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
* | ||
*/ | ||
|
||
# not ignore go and cue files | ||
!cmd/ | ||
!cue/ | ||
!cuego/ | ||
!encoding/ | ||
!internal/ | ||
!pkg/ | ||
!tools/ | ||
|
||
# not ignore go module files | ||
!go.mod | ||
!go.sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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"] |