-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 979 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (26 loc) · 979 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
FROM golang:1.10-alpine as builder
ARG GOOS=linux
ARG GOARCH=amd64
ARG GOARM=
WORKDIR /go/src/github.com/rchicoli/docker-log-elasticsearch
COPY . .
RUN apk add --no-cache git curl
# install dep
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
# RUN go get -d -v ./...
RUN dep ensure -v
# vendor/github.com/docker/docker/pkg/term/tc_linux_cgo.go:10:22:
# exec: "gcc": executable file not found in $PATH
# fatal error: termios.h: No such file or directory
RUN apk add --no-cache dev86 gcc musl-dev
# https://github.com/docker-library/golang/issues/86
RUN go list ./...
RUN go test -cover ./...
RUN CGO_ENABLED=0 go build -v -a -installsuffix cgo -o /usr/bin/docker-log-elasticsearch
FROM alpine:3.7
# TZ required to set the localtime
# TZ can be set with docker plugin command
RUN apk --no-cache add tzdata
COPY --from=builder /usr/bin/docker-log-elasticsearch /usr/bin/
WORKDIR /usr/bin
ENTRYPOINT [ "/usr/bin/docker-log-elasticsearch" ]