Slim coins and processor Dockerfiles

This commit is contained in:
Luke Parker
2023-07-21 04:27:14 -04:00
parent 92c3403698
commit 298d1fd3ba
4 changed files with 25 additions and 40 deletions

View File

@@ -10,12 +10,12 @@ WORKDIR /home/bitcoin
RUN apk update && \ RUN apk update && \
apk --no-cache add ca-certificates bash su-exec git gnupg apk --no-cache add ca-certificates bash su-exec git gnupg
# Get Binary # Download Bitcoin
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \ RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \
&& wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS \ && wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS \
&& wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc && wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
# Verify all sigs and check for valid signature from laanwj -- 71A3 # Verify all sigs and check for a valid signature from laanwj -- 71A3
RUN git clone https://github.com/bitcoin-core/guix.sigs && \ RUN git clone https://github.com/bitcoin-core/guix.sigs && \
cd guix.sigs/builder-keys && \ cd guix.sigs/builder-keys && \
find . -iname '*.gpg' -exec gpg --import {} \; && \ find . -iname '*.gpg' -exec gpg --import {} \; && \
@@ -26,12 +26,13 @@ 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 ubuntu:latest 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
COPY ./scripts /scripts COPY ./scripts /scripts
EXPOSE 8332 8333 18332 18333 18443 18444 EXPOSE 8332 8333 18332 18333 18443 18444

View File

@@ -5,4 +5,4 @@ RPC_PASS="${RPC_PASS:=seraidex}"
bitcoind -txindex -regtest \ bitcoind -txindex -regtest \
-rpcuser=$RPC_USER -rpcpassword=$RPC_PASS \ -rpcuser=$RPC_USER -rpcpassword=$RPC_PASS \
-rpcbind=127.0.0.1 -rpcbind=$(hostname) -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0 -rpcallowip=0.0.0.0/0

View File

@@ -14,7 +14,7 @@ WORKDIR /home/monero
RUN apk update \ RUN apk update \
&& apk --no-cache add ca-certificates gnupg bash su-exec && apk --no-cache add ca-certificates gnupg bash su-exec
# Get Binary # Download Monero
RUN wget https://downloads.getmonero.org/cli/monero-linux-x64-v${MONERO_VERSION}.tar.bz2 RUN wget https://downloads.getmonero.org/cli/monero-linux-x64-v${MONERO_VERSION}.tar.bz2
# Verify Binary -- fingerprint from https://github.com/monero-project/monero-site/issues/1949 # Verify Binary -- fingerprint from https://github.com/monero-project/monero-site/issues/1949
@@ -27,7 +27,9 @@ 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 ubuntu:latest 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/* .

View File

@@ -16,46 +16,28 @@ ADD AGPL-3.0 /serai
WORKDIR /serai WORKDIR /serai
# Update Rust RUN apt update && apt upgrade -y
RUN rustup update
# Install Solc @ 0.8.16 # Mount the caches and build
RUN --mount=type=cache,target=/root/.cache/ \ RUN --mount=type=cache,target=/root/.cargo/ \
--mount=type=cache,target=/root/.local/ \ --mount=type=cache,target=/serai/target \
--mount=type=cache,target=/root/.solc-select \ cd processor && \
pip3 install solc-select==0.2.1 cargo build --release --all-features && \
RUN --mount=type=cache,target=/root/.cache/ \ mkdir /serai/bin && \
--mount=type=cache,target=/root/.local/ \ mv /serai/target/release/serai-processor /serai/bin
--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
RUN --mount=type=cache,target=/root/.local/ \
--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=/serai/target/release/build \
--mount=type=cache,target=/serai/target/release/deps \
--mount=type=cache,target=/serai/target/release/.fingerprint \
--mount=type=cache,target=/serai/target/release/incremental \
--mount=type=cache,target=/serai/target/release/wbuild \
--mount=type=cache,target=/serai/target/release/lib* \
cd processor && cargo build --release --all-features
# Prepare Image # Prepare Image
FROM ubuntu:latest as image FROM debian:bullseye-slim as image
LABEL description="STAGE 2: Copy and Run" LABEL description="STAGE 2: Copy and Run"
WORKDIR /home/serai WORKDIR /home/serai
# Copy necessary files to run node # Copy necessary files to run node
COPY --from=builder /serai/target/release/ /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 ["processor"] CMD ["serai-processor"]