Update Dockerfiles to bookworm, successfully

Removes use of the Parity CI image. Always uses slim variants.
This commit is contained in:
Luke Parker 2023-07-26 03:06:01 -04:00
parent 0eb56406a4
commit 39eae2795f
No known key found for this signature in database
5 changed files with 33 additions and 30 deletions

View file

@ -26,12 +26,15 @@ RUN grep bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz SHA256SUMS | sha256s
# Prepare Image # Prepare Image
RUN tar xzvf bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz RUN tar xzvf bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
FROM debian:bullseye-slim as image FROM debian:bookworm-slim as image
WORKDIR /home/bitcoin WORKDIR /home/bitcoin
COPY --from=builder /home/bitcoin/* . COPY --from=builder /home/bitcoin/* .
RUN mv bin/* /bin && mv lib/* /lib RUN mv bin/* /bin && mv lib/* /lib
COPY ./scripts /scripts COPY ./scripts /scripts
# Upgrade packages
RUN apt update && apt upgrade -y
EXPOSE 8332 8333 18332 18333 18443 18444 EXPOSE 8332 8333 18332 18333 18443 18444
VOLUME ["/home/bitcoin/.bitcoin"] VOLUME ["/home/bitcoin/.bitcoin"]

View file

@ -27,12 +27,15 @@ RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --keyserver-options no-self-si
RUN tar -xvjf monero-linux-x64-v${MONERO_VERSION}.tar.bz2 --strip-components=1 RUN tar -xvjf monero-linux-x64-v${MONERO_VERSION}.tar.bz2 --strip-components=1
# Prepare Image # Prepare Image
FROM debian:bullseye-slim as image FROM debian:bookworm-slim as image
WORKDIR /home/monero WORKDIR /home/monero
COPY --from=builder /home/monero/* . COPY --from=builder /home/monero/* .
RUN mv * /bin/ RUN mv * /bin/
COPY ./scripts /scripts COPY ./scripts /scripts
# Upgrade packages
RUN apt update && apt upgrade -y
EXPOSE 18080 18081 EXPOSE 18080 18081
VOLUME /home/monero/.bitmonero VOLUME /home/monero/.bitmonero

View file

@ -1,4 +1,4 @@
FROM rust:1.71 as builder FROM rust:1.71-slim-bookworm as builder
LABEL description="STAGE 1: Build" LABEL description="STAGE 1: Build"
# Add files for build # Add files for build
@ -29,7 +29,7 @@ RUN --mount=type=cache,target=/root/.cargo \
mv /serai/target/release/serai-message-queue /serai/bin mv /serai/target/release/serai-message-queue /serai/bin
# Prepare Image # Prepare Image
FROM debian:bullseye-slim as image FROM debian:bookworm-slim as image
LABEL description="STAGE 2: Copy and Run" LABEL description="STAGE 2: Copy and Run"
WORKDIR /home/serai WORKDIR /home/serai
@ -38,6 +38,9 @@ WORKDIR /home/serai
COPY --from=builder /serai/bin/* /bin/ COPY --from=builder /serai/bin/* /bin/
COPY --from=builder /serai/AGPL-3.0 . COPY --from=builder /serai/AGPL-3.0 .
# Upgrade packages
RUN apt update && apt upgrade -y
# Run message-queue # Run message-queue
EXPOSE 2287 EXPOSE 2287
CMD ["serai-message-queue"] CMD ["serai-message-queue"]

View file

@ -1,4 +1,4 @@
FROM docker.io/paritytech/ci-linux:production as builder FROM rust:1.71-slim-bookworm as builder
LABEL description="STAGE 1: Build" LABEL description="STAGE 1: Build"
# Add files for build # Add files for build
@ -16,6 +16,11 @@ ADD AGPL-3.0 /serai
WORKDIR /serai WORKDIR /serai
RUN apt update && apt upgrade -y && apt install -y clang libssl-dev
# Add the wasm toolchain
RUN rustup target add wasm32-unknown-unknown
# Mount the caches and build # Mount the caches and build
RUN --mount=type=cache,target=/root/.cargo \ RUN --mount=type=cache,target=/root/.cargo \
--mount=type=cache,target=/usr/local/cargo/registry \ --mount=type=cache,target=/usr/local/cargo/registry \
@ -27,7 +32,7 @@ RUN --mount=type=cache,target=/root/.cargo \
mv /serai/target/release/serai-processor /serai/bin mv /serai/target/release/serai-processor /serai/bin
# Prepare Image # Prepare Image
FROM debian:bullseye-slim as image FROM debian:bookworm-slim as image
LABEL description="STAGE 2: Copy and Run" LABEL description="STAGE 2: Copy and Run"
WORKDIR /home/serai WORKDIR /home/serai
@ -36,8 +41,8 @@ WORKDIR /home/serai
COPY --from=builder /serai/bin/* /bin/ COPY --from=builder /serai/bin/* /bin/
COPY --from=builder /serai/AGPL-3.0 . COPY --from=builder /serai/AGPL-3.0 .
# Install openssl # Upgrade packages and install openssl
RUN apt update && apt upgrade -y && apt install -y libssl RUN apt update && apt upgrade -y && apt install -y libssl-dev
# Run processor # Run processor
CMD ["serai-processor"] CMD ["serai-processor"]

View file

@ -1,4 +1,4 @@
FROM docker.io/paritytech/ci-linux:production as builder FROM rust:1.71-slim-bookworm as builder
LABEL description="STAGE 1: Build" LABEL description="STAGE 1: Build"
# Add files for build # Add files for build
@ -16,34 +16,20 @@ ADD AGPL-3.0 /serai
WORKDIR /serai WORKDIR /serai
# Update Rust RUN apt update && apt upgrade -y && apt install -y make clang libssl-dev protobuf-compiler
RUN rustup update
# Install Solc @ 0.8.16 # Add the wasm toolchain
RUN --mount=type=cache,target=/root/.cache \ RUN rustup target add wasm32-unknown-unknown
--mount=type=cache,target=/root/.local \
--mount=type=cache,target=/root/.solc-select \
pip3 install solc-select==0.2.1
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/root/.local \
--mount=type=cache,target=/root/.solc-select \
solc-select install 0.8.16
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/root/.local \
--mount=type=cache,target=/root/.solc-select \
solc-select use 0.8.16
# Mount cargo and the Serai cache # Mount the caches and build
RUN --mount=type=cache,target=/root/.local \ RUN --mount=type=cache,target=/root/.cargo \
--mount=type=cache,target=/root/.solc-select \
--mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/usr/local/cargo/registry \ --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/serai/target \ --mount=type=cache,target=/serai/target \
cd substrate/node && cargo build --release cd substrate/node && cargo build --release
# Prepare Image # Prepare Image
FROM ubuntu:latest as image FROM debian:bookworm-slim as image
LABEL description="STAGE 2: Copy and Run" LABEL description="STAGE 2: Copy and Run"
WORKDIR /home/serai WORKDIR /home/serai
@ -52,6 +38,9 @@ WORKDIR /home/serai
COPY --from=builder /serai/target/release/ /bin/ COPY --from=builder /serai/target/release/ /bin/
COPY --from=builder /serai/AGPL-3.0 . COPY --from=builder /serai/AGPL-3.0 .
# Upgrade packages
RUN apt update && apt upgrade -y
# Run node # Run node
EXPOSE 30333 9615 9933 9944 EXPOSE 30333 9615 9933 9944
CMD ["serai-node"] CMD ["serai-node"]