-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from segmentio/mod_and_dockerfile_update
moved to go modules and moved to scratch image
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
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,2 +1,25 @@ | ||
FROM golang:onbuild | ||
FROM golang:1.14.4-alpine3.11 as builder | ||
|
||
RUN apk add --update ca-certificates git | ||
|
||
ENV SRC github.com/segmentio/segment-proxy | ||
ENV CGO_ENABLED=0 | ||
ENV GO111MODULE=on | ||
ENV GOOS=linux | ||
ENV GOARCH=amd64 | ||
|
||
ARG VERSION | ||
|
||
COPY . /go/src/${SRC} | ||
WORKDIR /go/src/${SRC} | ||
|
||
RUn go build -a -installsuffix cgo -ldflags "-w -s -extldflags '-static' -X main.version=$VERSION" -o /proxy | ||
|
||
FROM scratch | ||
|
||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=builder /proxy /proxy | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["/proxy"] |
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,5 @@ | ||
module github.com/segmentio/segment-proxy | ||
|
||
go 1.13 | ||
|
||
require github.com/gorilla/handlers v0.0.0-20160228171604-ee54c7b44cab |