mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-05 18:39:23 +00:00
Use non-slim variants to remove needing to apt additional packages
Prevents needing to rebuild all the time via allowing cache hits.
This commit is contained in:
parent
298d1fd3ba
commit
641077a089
4 changed files with 2 additions and 17 deletions
|
@ -28,8 +28,6 @@ RUN tar xzvf bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||||
|
|
||||||
FROM debian:bullseye-slim as image
|
FROM debian:bullseye-slim as image
|
||||||
|
|
||||||
RUN apt-get update && apt-get upgrade -y
|
|
||||||
|
|
||||||
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
|
||||||
|
|
|
@ -29,8 +29,6 @@ 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:bullseye-slim as image
|
||||||
|
|
||||||
RUN apt-get update && apt-get upgrade -y
|
|
||||||
|
|
||||||
WORKDIR /home/monero
|
WORKDIR /home/monero
|
||||||
COPY --from=builder /home/monero/* .
|
COPY --from=builder /home/monero/* .
|
||||||
RUN mv * /bin/
|
RUN mv * /bin/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM rust:1.71-slim as builder
|
FROM rust:1.71 as builder
|
||||||
LABEL description="STAGE 1: Build"
|
LABEL description="STAGE 1: Build"
|
||||||
|
|
||||||
# Add files for build
|
# Add files for build
|
||||||
|
@ -16,9 +16,6 @@ ADD AGPL-3.0 /serai
|
||||||
|
|
||||||
WORKDIR /serai
|
WORKDIR /serai
|
||||||
|
|
||||||
# Add necessary packages
|
|
||||||
RUN apt update && apt upgrade -y && apt install -y pkg-config clang libssl-dev
|
|
||||||
|
|
||||||
# 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=/serai/target \
|
--mount=type=cache,target=/serai/target \
|
||||||
|
@ -33,9 +30,6 @@ LABEL description="STAGE 2: Copy and Run"
|
||||||
|
|
||||||
WORKDIR /home/serai
|
WORKDIR /home/serai
|
||||||
|
|
||||||
# Update for security purposes
|
|
||||||
RUN apt update && apt upgrade -y
|
|
||||||
|
|
||||||
# Copy the Message Queue binary and relevant license
|
# Copy the Message Queue binary and relevant license
|
||||||
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 .
|
||||||
|
|
|
@ -16,8 +16,6 @@ ADD AGPL-3.0 /serai
|
||||||
|
|
||||||
WORKDIR /serai
|
WORKDIR /serai
|
||||||
|
|
||||||
RUN apt update && apt upgrade -y
|
|
||||||
|
|
||||||
# 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=/serai/target \
|
--mount=type=cache,target=/serai/target \
|
||||||
|
@ -27,7 +25,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:bullseye as image
|
||||||
LABEL description="STAGE 2: Copy and Run"
|
LABEL description="STAGE 2: Copy and Run"
|
||||||
|
|
||||||
WORKDIR /home/serai
|
WORKDIR /home/serai
|
||||||
|
@ -36,8 +34,5 @@ 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
|
|
||||||
RUN apt update && apt upgrade -y && apt install -y openssl
|
|
||||||
|
|
||||||
# Run processor
|
# Run processor
|
||||||
CMD ["serai-processor"]
|
CMD ["serai-processor"]
|
||||||
|
|
Loading…
Reference in a new issue