fix: better multi-stage build

This commit is contained in:
arielherself 2024-04-08 16:13:16 +08:00
parent f3e9c1502c
commit 363e1c8215
Signed by: arielherself
SSH Key Fingerprint: SHA256:AK3cyo9tFsp7Mox7K0sYphleC8hReXhnRKxwuDT5LBc
3 changed files with 14 additions and 7 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "boost"]
path = boost
url = https://github.com/boostorg/boost

View File

@ -1,16 +1,19 @@
FROM debian:12.5 FROM debian:12.5 as builder
MAINTAINER arielherself MAINTAINER arielherself
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt update RUN apt update
RUN apt install git build-essential software-properties-common autoconf automake libtool pkg-config ca-certificates libssl-dev locales locales-all libzstd-dev liblzma-dev libbz2-dev libz-dev -y RUN apt install --no-install-recommends build-essential ca-certificates libssl-dev libzstd-dev liblzma-dev libbz2-dev libz-dev -y
RUN apt clean RUN apt clean
ENV LC_ALL en_US.UTF-8 RUN mkdir /boost_inst
ENV LANG en_US.UTF-8 RUN mkdir /boost_target
ENV LANGUAGE en_US.UTF-8 ADD ./boost /boost_inst
RUN git clone "https://github.com/boostorg/boost" /boost_inst --recursive
WORKDIR /boost_inst WORKDIR /boost_inst
RUN ./bootstrap.sh RUN ./bootstrap.sh --prefix=/boost_target
RUN ./b2 install -q RUN ./b2 install -q
WORKDIR / WORKDIR /
RUN rm -rf /boost_inst RUN rm -rf /boost_inst
FROM debian:12.5
COPY --from=builder /boost_target/include/. /usr/local/include/
COPY --from=builder /boost_target/lib/. /usr/local/lib/

1
boost Submodule

@ -0,0 +1 @@
Subproject commit cd2c160f11f1141ca18944dbbf46fdd8fe60e3af