Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Extend Dockerfile to use plain multi stage build #438

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
FROM golang:1.10.2 as builder

WORKDIR /go/src/github.com/keycloak/keycloak-gatekeeper
COPY . ./

RUN go get -u github.com/golang/dep/cmd/dep \
&& dep ensure \
&& go test

RUN CGO_ENABLED=0 go build -a -ldflags '-s' -installsuffix cgo -o bin/keycloak-gatekeeper .

FROM alpine:3.7

LABEL Name=keycloak-gatekeeper \
Expand All @@ -8,8 +19,9 @@ LABEL Name=keycloak-gatekeeper \
RUN apk add --no-cache ca-certificates

ADD templates/ /opt/templates
ADD bin/keycloak-gatekeeper /opt/keycloak-gatekeeper

COPY --from=builder /go/src/github.com/keycloak/keycloak-gatekeeper/bin/keycloak-gatekeeper /opt/keycloak-gatekeeper

WORKDIR "/opt"

ENTRYPOINT [ "/opt/keycloak-gatekeeper" ]
ENTRYPOINT ["/opt/keycloak-gatekeeper"]