You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
telegabber/Dockerfile

37 lines
849 B

FROM golang:1.19-bookworm AS base
RUN apt-get update
run apt-get install -y libssl-dev cmake build-essential gperf libz-dev make git
FROM base AS tdlib
ARG TD_COMMIT
ARG MAKEOPTS
RUN git clone https://github.com/tdlib/td /src/
RUN git -C /src/ checkout "${TD_COMMIT}"
RUN mkdir build
WORKDIR /build/
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/compiled/ /src/
RUN cmake --build . ${MAKEOPTS}
RUN make install
FROM base AS cache
ARG VERSION
COPY --from=tdlib /compiled/ /usr/local/
COPY ./ /src
RUN git -C /src checkout "${VERSION}"
WORKDIR /src
RUN go get
FROM cache AS build
ARG MAKEOPTS
WORKDIR /src
RUN make ${MAKEOPTS}
FROM scratch AS telegabber
COPY --from=build /src/release/telegabber /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/telegabber"]
FROM scratch AS binaries
COPY --from=telegabber /usr/local/bin/telegabber /