FROM golang:1.27.2-alpine@sha256:f92b6ef800e499660581efdabdf25d9d817a9d124eaf900924f0504e7e27e12d AS builder RUN apk add --no-cache python3 patch build-base # The pinned upstream compiles in a layer of its own, before the patches: when only a patch changes, the build # below starts from this layer's Go build cache and recompiles just the packages the patches touch. COPY build.py upstream.json /source/ RUN python3 /source/build.py --warm # services/bridgekit, which every bridge is built with, comes in as the named build context bridgekit # (compose.local.yaml, docker-bake.hcl, infra/scripts/release.py). COPY --from=bridgekit . /bridgekit ENV XESSENGER_BRIDGEKIT=/bridgekit COPY . /source RUN python3 /source/build.py --output /out/mautrix-telegram FROM dock.mau.dev/mautrix/telegram:v0.2610.0@sha256:ed3f3b39289fae425a875311d8875729271c24f88ba03209bd1bfbaf31e6c78f COPY --from=builder /out/mautrix-telegram /usr/bin/mautrix-telegram