-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: Update Dockerfile build instructions
Signed-off-by: aeneasr <[email protected]>
- Loading branch information
Showing
1 changed file
with
7 additions
and
20 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 |
---|---|---|
@@ -1,27 +1,14 @@ | ||
FROM golang:1.11-alpine | ||
# To compile this image manually run: | ||
# | ||
# $ GO111MODULE=on GOOS=linux GOARCH=amd64 go build && docker build -t oryd/oathkeeper . && rm oathkeeper | ||
FROM alpine:3.9 | ||
|
||
ARG git_tag | ||
ARG git_commit | ||
|
||
RUN apk add --no-cache git build-base | ||
|
||
WORKDIR /go/src/github.com/ory/oathkeeper | ||
|
||
ENV GO111MODULE=on | ||
|
||
ADD ./go.mod ./go.mod | ||
ADD ./go.sum ./go.sum | ||
|
||
RUN go mod download | ||
|
||
ADD . . | ||
|
||
RUN go mod verify | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -X github.com/ory/oathkeeper/cmd.Version=$git_tag -X github.com/ory/oathkeeper/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/oathkeeper/cmd.GitHash=$git_commit" -a -installsuffix cgo -o oathkeeper | ||
RUN apk add -U --no-cache ca-certificates | ||
|
||
FROM scratch | ||
|
||
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=0 /go/src/github.com/ory/oathkeeper/oathkeeper /usr/bin/oathkeeper | ||
COPY oathkeeper /usr/bin/oathkeeper | ||
COPY .releaser/LICENSE.txt /LICENSE.txt | ||
|
||
ENTRYPOINT ["oathkeeper"] |