Experiment with multiple build stages

This commit is contained in:
Mikhail f. Shiryaev 2023-02-09 19:13:44 +01:00
parent 1ef1eefa26
commit 376b5d178f
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -1,6 +1,8 @@
# docker build -t clickhouse/binary-builder .
ARG FROM_TAG=latest
FROM clickhouse/test-util:$FROM_TAG
FROM clickhouse/test-util:latest AS cctools
# The cctools are built always from the clickhouse/test-util:latest and cached inline
# Theoretically, it should improve rebuild speed significantly
ENV CC=clang-${LLVM_VERSION}
ENV CXX=clang++-${LLVM_VERSION}
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@ -37,6 +39,11 @@ RUN git clone --depth 1 https://github.com/tpoechtrager/cctools-port.git \
# END COMPILE
# !!!!!!!!!!!
FROM clickhouse/test-util:$FROM_TAG
ENV CC=clang-${LLVM_VERSION}
ENV CXX=clang++-${LLVM_VERSION}
COPY --from=cctools /cctools /cctools
# Rust toolchain and libraries
ENV RUSTUP_HOME=/rust/rustup
ENV CARGO_HOME=/rust/cargo