2020-02-25 22:26:57 +01:00
|
|
|
FROM golang:1.12-alpine AS builder
|
2018-08-24 22:06:55 +02:00
|
|
|
|
2019-01-12 14:54:04 +01:00
|
|
|
RUN apk add --no-cache git ca-certificates build-base su-exec
|
2018-08-26 16:29:51 +02:00
|
|
|
|
2019-01-12 14:54:04 +01:00
|
|
|
WORKDIR /build
|
|
|
|
COPY go.mod go.sum /build/
|
|
|
|
RUN go get
|
2018-08-26 16:29:51 +02:00
|
|
|
|
2019-01-12 14:54:04 +01:00
|
|
|
COPY . /build
|
2018-08-26 16:29:51 +02:00
|
|
|
RUN go build -o /usr/bin/mautrix-whatsapp
|
2018-08-24 22:06:55 +02:00
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
|
2018-10-24 15:46:15 +02:00
|
|
|
ENV UID=1337 \
|
|
|
|
GID=1337
|
|
|
|
|
2019-01-12 14:54:04 +01:00
|
|
|
RUN apk add --no-cache su-exec ca-certificates
|
2018-10-24 15:46:15 +02:00
|
|
|
|
2018-08-24 22:06:55 +02:00
|
|
|
COPY --from=builder /usr/bin/mautrix-whatsapp /usr/bin/mautrix-whatsapp
|
2019-02-10 12:17:35 +01:00
|
|
|
COPY --from=builder /build/example-config.yaml /opt/mautrix-whatsapp/example-config.yaml
|
|
|
|
COPY --from=builder /build/docker-run.sh /docker-run.sh
|
2018-08-24 22:06:55 +02:00
|
|
|
VOLUME /data
|
|
|
|
|
|
|
|
CMD ["/docker-run.sh"]
|