Skip to content

Commit

Permalink
docker: Update Dockerfile build instructions
Browse files Browse the repository at this point in the history
Signed-off-by: aeneasr <aeneas@ory.sh>
  • Loading branch information
aeneasr committed Apr 8, 2019
1 parent 529e05e commit ec40cc4
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions Dockerfile
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"]

0 comments on commit ec40cc4

Please sign in to comment.