Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dockerfile
.travis.yml
25 changes: 19 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
FROM alpine:latest
MAINTAINER MessageBird <[email protected]>
# ##### builder stage #####
FROM alpine:latest AS builder
LABEL maintainer="[email protected]"

ENV GOPATH=/usr/local

RUN apk add --no-cache musl-dev go git && \
go get -u github.com/golang/dep/cmd/dep

ADD . /usr/local/src/pushprom
WORKDIR /usr/local/src/pushprom

# Copy over the binary in the container.
ADD bin/pushprom /usr/bin/
RUN dep ensure -v && \
go test && \
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -ldflags "-s -w" -o "/usr/local/bin/pushprom"

# ##### image stage #####
FROM alpine:latest
COPY --from=builder /usr/local/bin/pushprom /usr/local/bin/pushprom

EXPOSE 9090 9091

# Run
CMD ["/usr/bin/pushprom"]

CMD ["/usr/local/bin/pushprom"]