-
-
Notifications
You must be signed in to change notification settings - Fork 53
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 #8 from sachk/master
Make the docker container smaller and add documentation
- Loading branch information
Showing
2 changed files
with
16 additions
and
3 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,11 +1,14 @@ | ||
FROM golang | ||
FROM golang:alpine as builder | ||
|
||
WORKDIR /go/src/github.com/boynux/squid-exporter | ||
COPY . . | ||
|
||
# Compile the binary statically, so it can be run without libraries. | ||
RUN CGO_ENABLED=0 GOOS=linux go install -a -ldflags '-extldflags "-static"' . | ||
|
||
FROM alpine | ||
COPY --from=0 /go/bin/squid-exporter /usr/local/bin/squid-exporter | ||
FROM scratch | ||
COPY --from=builder /go/bin/squid-exporter /usr/local/bin/squid-exporter | ||
|
||
EXPOSE 9301 | ||
|
||
ENTRYPOINT ["/usr/local/bin/squid-exporter"] |
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