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

Rewrite Dockerfile not to rely on local build artifacts presence #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 4 additions & 8 deletions .dockerignore
Expand Up @@ -10,20 +10,16 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# External packages folder
vendor
_vendor-*/

# Dot env files
.env

# Git folder
.git

# Build and release artifacts
.build
bin/faktory_exporter*
faktory_exporter
*.tar.gz
*.mprof
*-stamp
*-stamp

# To prevent Docker layer cache misses in Dockerfile-only changes
Dockerfile
16 changes: 15 additions & 1 deletion Dockerfile
@@ -1,7 +1,21 @@
FROM golang:1.11 AS builder

RUN go get -u github.com/golang/dep/cmd/dep

RUN mkdir -p $GOPATH/src/github.com/lukasmalkmus/faktory_exporter/

COPY . $GOPATH/src/github.com/lukasmalkmus/faktory_exporter/

WORKDIR $GOPATH/src/github.com/lukasmalkmus/faktory_exporter/

RUN dep ensure

RUN make PREFIX=/bin

FROM quay.io/prometheus/busybox:latest
LABEL maintainer "Lukas Malkmus <mail@lukasmalkmus.com>"

COPY faktory_exporter /bin/faktory_exporter
COPY --from=builder /bin/faktory_exporter /bin/faktory_exporter

EXPOSE 9386
ENTRYPOINT ["/bin/faktory_exporter"]