Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The build phase makes the assumption that any capnproto-files are pre-processed before building in-docker.
- Loading branch information
Johan Bergström
committed
Apr 30, 2019
1 parent
137928e
commit 1deec64
Showing
2 changed files
with
21 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,17 @@ | ||
FROM golang:1.12-alpine as builder | ||
|
||
WORKDIR /go/src/github.com/cloudflare/cloudflared/ | ||
COPY . . | ||
|
||
RUN apk add --no-cache gcc musl-dev git upx ca-certificates | ||
RUN VERSION=$(git describe --tags --always --dirty="-dev") && \ | ||
DATE=$(date -u '+%Y-%m-%dT%H:%MZ') && \ | ||
go build -ldflags "-X main.Version=\"${VERSION}\" -X main.BuildTime=\"${DATE}\"" \ | ||
-installsuffix cgo -o cloudflared ./cmd/cloudflared | ||
RUN upx --no-progress cloudflared | ||
|
||
FROM alpine:3.9 | ||
COPY --from=builder /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/ | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
ENTRYPOINT ["cloudflared"] | ||
CMD ["version"] |
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