mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Move apt calls in Docker to enable caching
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user