mautrix-whatsapp/Dockerfile

29 lines
997 B
Docker
Raw Normal View History

2020-06-23 15:40:05 +02:00
FROM golang:1-alpine3.12 AS builder
2018-08-24 22:06:55 +02:00
2020-05-08 22:53:30 +02:00
RUN echo "@edge_community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk add --no-cache git ca-certificates build-base su-exec olm-dev@edge_community
2018-08-26 16:29:51 +02:00
COPY . /build
2020-06-07 20:20:57 +02:00
WORKDIR /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
2020-06-23 15:40:05 +02:00
FROM alpine:3.12
2018-08-24 22:06:55 +02:00
2020-08-14 23:50:26 +02:00
ARG TARGETARCH=amd64
ARG YQ_DOWNLOAD_ADDR=https://github.com/mikefarah/yq/releases/download/3.3.2/yq_linux_${TARGETARCH}
2020-08-14 23:10:44 +02:00
ENV UID=1337 \
GID=1337
2020-05-08 22:53:30 +02:00
RUN echo "@edge_community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
2020-08-14 23:10:44 +02:00
RUN apk add --no-cache ffmpeg su-exec ca-certificates olm@edge_community bash jq curl && \
curl -sLo yq ${YQ_DOWNLOAD_ADDR} && \
chmod +x yq && mv yq /usr/bin/yq
2018-08-24 22:06:55 +02:00
COPY --from=builder /usr/bin/mautrix-whatsapp /usr/bin/mautrix-whatsapp
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"]