diff --git a/orchestration/coins/bitcoin/Dockerfile b/orchestration/coins/bitcoin/Dockerfile index 3d5f9a6a..478c7589 100644 --- a/orchestration/coins/bitcoin/Dockerfile +++ b/orchestration/coins/bitcoin/Dockerfile @@ -30,7 +30,7 @@ RUN mv bitcoin-${BITCOIN_VERSION}/bin/bitcoind . FROM debian:bookworm-slim as image # Upgrade packages -RUN apt update && apt upgrade -y +RUN apt update && apt upgrade -y && && apt autoremove -y && apt clean # Switch to a non-root user RUN useradd --system --create-home --shell /sbin/nologin bitcoin diff --git a/orchestration/coordinator/Dockerfile b/orchestration/coordinator/Dockerfile index d0d4a5ec..039a5819 100644 --- a/orchestration/coordinator/Dockerfile +++ b/orchestration/coordinator/Dockerfile @@ -1,6 +1,12 @@ FROM rust:1.71-slim-bookworm as builder LABEL description="STAGE 1: Build" +# Upgrade and add dev dependencies +RUN apt update && apt upgrade -y && apt install -y pkg-config clang libssl-dev && apt autoremove -y && apt clean + +# Add the wasm toolchain +RUN rustup target add wasm32-unknown-unknown + # Add files for build ADD common /serai/common ADD crypto /serai/crypto @@ -16,11 +22,6 @@ ADD AGPL-3.0 /serai WORKDIR /serai -RUN apt update && apt upgrade -y && apt install -y pkg-config clang libssl-dev - -# Add the wasm toolchain -RUN rustup target add wasm32-unknown-unknown - # Mount the caches and build RUN --mount=type=cache,target=/root/.cargo \ --mount=type=cache,target=/usr/local/cargo/registry \ @@ -36,7 +37,7 @@ FROM debian:bookworm-slim as image LABEL description="STAGE 2: Copy and Run" # Upgrade packages and install openssl -RUN apt update && apt upgrade -y && apt install -y libssl-dev +RUN apt update && apt upgrade -y && apt install -y libssl-dev && apt autoremove && apt clean # Switch to a non-root user RUN useradd --system --create-home --shell /sbin/nologin coordinator diff --git a/orchestration/message-queue/Dockerfile b/orchestration/message-queue/Dockerfile index 738704e5..c4a17fce 100644 --- a/orchestration/message-queue/Dockerfile +++ b/orchestration/message-queue/Dockerfile @@ -1,6 +1,9 @@ FROM rust:1.71-slim-bookworm as builder LABEL description="STAGE 1: Build" +# Upgrade and add dev dependencies +RUN apt update && apt upgrade -y && apt install -y pkg-config clang libssl-dev && apt autoremove -y && apt clean + # Add files for build ADD common /serai/common ADD crypto /serai/crypto @@ -16,8 +19,6 @@ ADD AGPL-3.0 /serai WORKDIR /serai -RUN apt update && apt install -y pkg-config clang libssl-dev - # Mount the caches and build RUN --mount=type=cache,target=/root/.cargo \ --mount=type=cache,target=/usr/local/cargo/registry \ diff --git a/orchestration/processor/Dockerfile b/orchestration/processor/Dockerfile index 7cd4005a..13c7559f 100644 --- a/orchestration/processor/Dockerfile +++ b/orchestration/processor/Dockerfile @@ -1,6 +1,9 @@ FROM rust:1.71-slim-bookworm as builder LABEL description="STAGE 1: Build" +# Upgrade and add dev dependencies +RUN apt update && apt upgrade -y && apt install -y pkg-config clang libssl-dev && apt autoremove -y && apt clean + # Add files for build ADD common /serai/common ADD crypto /serai/crypto @@ -16,8 +19,6 @@ ADD AGPL-3.0 /serai WORKDIR /serai -RUN apt update && apt upgrade -y && apt install -y pkg-config clang libssl-dev - # Add the wasm toolchain RUN rustup target add wasm32-unknown-unknown diff --git a/orchestration/runtime/Dockerfile b/orchestration/runtime/Dockerfile index b690a9a4..4d10530b 100644 --- a/orchestration/runtime/Dockerfile +++ b/orchestration/runtime/Dockerfile @@ -1,5 +1,17 @@ FROM rust:1.71.1-slim-bookworm as builder +# Move to a Debian package snapshot +RUN rm -rf /etc/apt/sources.list.d/debian.sources && \ + rm -rf /var/lib/apt/lists/* && \ + echo "deb [arch=amd64] http://snapshot.debian.org/archive/debian/20230703T000000Z bookworm main" > /etc/apt/sources.list && \ + apt update + +# Install dependencies +RUN apt install clang -y + +# Add the wasm toolchain +RUN rustup target add wasm32-unknown-unknown + # Add files for build ADD common /serai/common ADD crypto /serai/crypto @@ -14,15 +26,3 @@ ADD Cargo.lock /serai ADD AGPL-3.0 /serai WORKDIR /serai - -# Move to a Debian package snapshot -RUN rm -rf /etc/apt/sources.list.d/debian.sources && \ - rm -rf /var/lib/apt/lists/* && \ - echo "deb [arch=amd64] http://snapshot.debian.org/archive/debian/20230703T000000Z bookworm main" > /etc/apt/sources.list && \ - apt update - -# Install dependencies -RUN apt install clang -y - -# Add the wasm toolchain -RUN rustup target add wasm32-unknown-unknown diff --git a/orchestration/serai/Dockerfile b/orchestration/serai/Dockerfile index 510a52b0..8c5d8347 100644 --- a/orchestration/serai/Dockerfile +++ b/orchestration/serai/Dockerfile @@ -1,6 +1,9 @@ FROM rust:1.71-slim-bookworm as builder LABEL description="STAGE 1: Build" +# Upgrade and add dev dependencies +RUN apt update && apt upgrade -y && apt install -y git pkg-config make clang libssl-dev protobuf-compiler && apt autoremove -y && apt clean + # Add files for build ADD common /serai/common ADD crypto /serai/crypto @@ -16,8 +19,6 @@ ADD AGPL-3.0 /serai WORKDIR /serai -RUN apt update && apt upgrade -y && apt install -y git pkg-config make clang libssl-dev protobuf-compiler - # Add the wasm toolchain RUN rustup target add wasm32-unknown-unknown