blob: 403ae141f7ec5c18ea245fc1029e6db94749444e [file] [log] [blame]
avm9996388e622d2021-01-22 18:57:58 +01001FROM golang:latest as builder
2
3ENV CGO_ENABLED=0
4
5ENV GO111MODULE=on
6ENV GOPROXY=https://proxy.golang.org
7
8RUN mkdir /gocache
9ENV GOCACHE /gocache
10
11COPY go.mod /go/src/gomodules.avm99963.com/hichip2mqtt/go.mod
12COPY go.sum /go/src/gomodules.avm99963.com/hichip2mqtt/go.sum
13
14WORKDIR /go/src/gomodules.avm99963.com/hichip2mqtt
15
16# Optimization for iterative docker build speed, not necessary for correctness:
17RUN go install github.com/eclipse/paho.mqtt.golang
18RUN go install github.com/flashmob/go-guerrilla
19RUN go install github.com/go-sql-driver/mysql
avm999638355e002021-01-26 23:05:01 +010020RUN go install github.com/minio/minio-go/v7
avm9996388e622d2021-01-22 18:57:58 +010021RUN go install github.com/sirupsen/logrus
22RUN go install github.com/spf13/cobra
23RUN go install gomodules.avm99963.com/forks/parsemail
24
25WORKDIR /go/src/gomodules.avm99963.com/hichip2mqtt/cmd/hichipbridge
26
27COPY . /go/src/gomodules.avm99963.com/hichip2mqtt/cmd/hichipbridge
28
29RUN go install gomodules.avm99963.com/hichip2mqtt/cmd/hichipbridge
30
31FROM alpine
32LABEL maintainer "me@avm99963.com"
33
34RUN apk add --no-cache tini
35COPY --from=builder /go/bin/hichipbridge /
36ENTRYPOINT ["/sbin/tini", "--", "/hichipbridge", "serve"]