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