Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimalize Dockerfile #378

Merged
merged 5 commits into from
Mar 2, 2018
Merged
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
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM golang:1.9-alpine as builder
RUN apk add --update git
RUN apk add ca-certificates

WORKDIR /go/src/github.com/serverless/event-gateway
COPY . .
Expand All @@ -11,11 +12,11 @@ RUN go get -u golang.org/x/net/http2
RUN go get -u golang.org/x/net/trace
RUN go get -u github.com/golang/dep/cmd/dep
RUN dep ensure
RUN go build -o event-gateway cmd/event-gateway/main.go
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s' -a -installsuffix cgo -o event-gateway cmd/event-gateway/main.go

FROM alpine:3.6
RUN apk add --no-cache ca-certificates
WORKDIR /app/
COPY --from=builder /go/src/github.com/serverless/event-gateway/event-gateway .
FROM scratch
WORKDIR /
COPY --from=builder /go/src/github.com/serverless/event-gateway/event-gateway /
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
EXPOSE 4000 4001
ENTRYPOINT ["./event-gateway"]
ENTRYPOINT ["/event-gateway"]