Dockerfile 987 B

12345678910111213141516171819202122232425262728293031
  1. FROM golang:1-alpine3.12 AS builder
  2. RUN echo $'\
  3. @edge http://dl-cdn.alpinelinux.org/alpine/edge/main\n\
  4. @edge http://dl-cdn.alpinelinux.org/alpine/edge/testing\n\
  5. @edge http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
  6. RUN apk add --no-cache git ca-certificates build-base su-exec olm-dev
  7. COPY . /build
  8. WORKDIR /build
  9. RUN go build -o /usr/bin/mautrix-whatsapp
  10. FROM alpine:3.12
  11. RUN echo $'\
  12. @edge http://dl-cdn.alpinelinux.org/alpine/edge/main\n\
  13. @edge http://dl-cdn.alpinelinux.org/alpine/edge/testing\n\
  14. @edge http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
  15. ENV UID=1337 \
  16. GID=1337
  17. RUN apk add --no-cache ffmpeg su-exec ca-certificates olm bash jq yq@edge curl
  18. COPY --from=builder /usr/bin/mautrix-whatsapp /usr/bin/mautrix-whatsapp
  19. COPY --from=builder /build/example-config.yaml /opt/mautrix-whatsapp/example-config.yaml
  20. COPY --from=builder /build/docker-run.sh /docker-run.sh
  21. VOLUME /data
  22. CMD ["/docker-run.sh"]