This commit is contained in:
Luke Parker
2023-09-19 12:55:30 -04:00
parent a9468bf355
commit e455332e01
6 changed files with 95 additions and 13 deletions

View File

@@ -32,9 +32,23 @@ RUN --mount=type=cache,target=/root/.cargo \
mkdir /serai/bin && \
mv /serai/target/release/serai-coordinator /serai/bin
# Prepare Image
# Also build mimalloc
FROM debian:bookworm-slim as mimalloc
RUN apt update && apt upgrade -y && apt install -y gcc g++ make cmake git
RUN git clone https://github.com/microsoft/mimalloc && \
cd mimalloc && \
mkdir -p out/secure && \
cd out/secure && \
cmake -DMI_SECURE=ON ../.. && \
make && \
cp ./libmimalloc-secure.so ../../../libmimalloc.so
# Build the actual image
FROM debian:bookworm-slim as image
LABEL description="STAGE 2: Copy and Run"
COPY --from=mimalloc libmimalloc.so /usr/lib
RUN echo "/usr/lib/libmimalloc.so" >> /etc/ld.so.preload
# Upgrade packages and install openssl
RUN apt update && apt upgrade -y && apt install -y libssl-dev && apt autoremove && apt clean