-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
26 lines (23 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM golang:alpine as build
MAINTAINER timo.taskinen@vincit.fi
LABEL maintainer "timo.taskinen@vincit.fi"
ENV LOGSPOUT_VERSION=3.2.6
ENV LOGSPOUT_DOWNLOAD_SHA256=18e2d79bec5d31cf467efc1fddccc0257adacd30391d28f299a1bfa7bb9d8383
RUN mkdir -p /go/src
WORKDIR /go/src
VOLUME /mnt/routes
EXPOSE 80
RUN apk --no-cache add curl git gcc musl-dev
RUN curl -fSL -o logspout.tar.gz "https://github.com/gliderlabs/logspout/archive/v${LOGSPOUT_VERSION}.tar.gz" \
&& echo "$LOGSPOUT_DOWNLOAD_SHA256 *logspout.tar.gz" | sha256sum -c - \
&& tar -zxvf logspout.tar.gz \
&& rm logspout.tar.gz \
&& mkdir -p /go/src/github.com/gliderlabs/ \
&& mv logspout-${LOGSPOUT_VERSION} /go/src/github.com/gliderlabs/logspout
WORKDIR /go/src/github.com/gliderlabs/logspout
RUN echo 'import ( _ "github.com/micahhausler/logspout-gelf" )' >> /go/src/github.com/gliderlabs/logspout/modules.go
RUN go get -d -v ./...
RUN go build -v -ldflags "-X main.Version=$(cat VERSION)" -o ./bin/logspout
FROM alpine:latest
COPY --from=build /go/src/github.com/gliderlabs/logspout/bin/logspout /go/bin/logspout
ENTRYPOINT ["/go/bin/logspout"]