Reduce Dockerfile stages

This commit is contained in:
Bohdan Horbeshko 2026-08-06 13:16:43 -04:00
parent 4a1b0f4ccc
commit a117e1e3cb
3 changed files with 3 additions and 9 deletions

View file

@ -1,7 +1,6 @@
FROM golang:1.24-bookworm AS base FROM golang:1.24-bookworm AS base
RUN apt-get update RUN apt-get update && apt-get install -y libssl-dev cmake build-essential gperf libz-dev make git libomemo-c-dev
run apt-get install -y libssl-dev cmake build-essential gperf libz-dev make git libomemo-c-dev
FROM base AS tdlib FROM base AS tdlib
@ -9,7 +8,6 @@ ARG TD_COMMIT
ARG MAKEOPTS ARG MAKEOPTS
RUN git clone https://github.com/tdlib/td /src/ RUN git clone https://github.com/tdlib/td /src/
RUN git -C /src/ checkout "${TD_COMMIT}" RUN git -C /src/ checkout "${TD_COMMIT}"
RUN mkdir build
WORKDIR /build/ WORKDIR /build/
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/compiled/ /src/ RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/compiled/ /src/
RUN cmake --build . ${MAKEOPTS} RUN cmake --build . ${MAKEOPTS}

View file

@ -1,7 +1,6 @@
FROM golang:1.24-bullseye AS base FROM golang:1.24-bullseye AS base
RUN apt-get update RUN apt-get update && apt-get install -y libssl-dev cmake build-essential gperf libz-dev make git php libsignal-protocol-c-dev
RUN apt-get install -y libssl-dev cmake build-essential gperf libz-dev make git php libsignal-protocol-c-dev
FROM base AS tdlib FROM base AS tdlib
@ -9,7 +8,6 @@ ARG TD_COMMIT
ARG MAKEOPTS ARG MAKEOPTS
RUN git clone https://github.com/tdlib/td /src/ RUN git clone https://github.com/tdlib/td /src/
RUN git -C /src/ checkout "${TD_COMMIT}" RUN git -C /src/ checkout "${TD_COMMIT}"
RUN mkdir build
WORKDIR /build/ WORKDIR /build/
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/compiled/ /src/ RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/compiled/ /src/
RUN cmake --build . --target prepare_cross_compiling ${MAKEOPTS} RUN cmake --build . --target prepare_cross_compiling ${MAKEOPTS}

View file

@ -1,7 +1,6 @@
FROM golang:1.24-bookworm AS base FROM golang:1.24-bookworm AS base
RUN apt-get update RUN apt-get update && apt-get install -y libssl-dev cmake build-essential gperf libz-dev make git php
RUN apt-get install -y libssl-dev cmake build-essential gperf libz-dev make git php
FROM base AS tdlib FROM base AS tdlib
@ -9,7 +8,6 @@ ARG TD_COMMIT
ARG MAKEOPTS ARG MAKEOPTS
RUN git clone https://github.com/tdlib/td /src/ RUN git clone https://github.com/tdlib/td /src/
RUN git -C /src/ checkout "${TD_COMMIT}" RUN git -C /src/ checkout "${TD_COMMIT}"
RUN mkdir build
WORKDIR /build/ WORKDIR /build/
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/compiled/ /src/ RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/compiled/ /src/
RUN cmake --build . --target prepare_cross_compiling ${MAKEOPTS} RUN cmake --build . --target prepare_cross_compiling ${MAKEOPTS}