diff --git a/deploy/coins/bitcoin/Dockerfile b/deploy/coins/bitcoin/Dockerfile index 3e82253e..f0036da8 100644 --- a/deploy/coins/bitcoin/Dockerfile +++ b/deploy/coins/bitcoin/Dockerfile @@ -10,12 +10,12 @@ WORKDIR /home/bitcoin RUN apk update && \ 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 \ && wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS \ && 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 && \ cd guix.sigs/builder-keys && \ 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 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 COPY --from=builder /home/bitcoin/* . - RUN mv bin/* /bin && mv lib/* /lib - COPY ./scripts /scripts EXPOSE 8332 8333 18332 18333 18443 18444 diff --git a/deploy/coins/bitcoin/scripts/entry-dev.sh b/deploy/coins/bitcoin/scripts/entry-dev.sh index 12712eac..702dac89 100755 --- a/deploy/coins/bitcoin/scripts/entry-dev.sh +++ b/deploy/coins/bitcoin/scripts/entry-dev.sh @@ -5,4 +5,4 @@ RPC_PASS="${RPC_PASS:=seraidex}" bitcoind -txindex -regtest \ -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 diff --git a/deploy/coins/monero/Dockerfile b/deploy/coins/monero/Dockerfile index 6a64294b..b90c4e6a 100644 --- a/deploy/coins/monero/Dockerfile +++ b/deploy/coins/monero/Dockerfile @@ -14,7 +14,7 @@ WORKDIR /home/monero RUN apk update \ && 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 # 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 # Prepare Image -FROM ubuntu:latest as image +FROM debian:bullseye-slim as image + +RUN apt-get update && apt-get upgrade -y WORKDIR /home/monero COPY --from=builder /home/monero/* . diff --git a/deploy/processor/Dockerfile b/deploy/processor/Dockerfile index 8fd36894..530e01cf 100644 --- a/deploy/processor/Dockerfile +++ b/deploy/processor/Dockerfile @@ -16,46 +16,28 @@ ADD AGPL-3.0 /serai WORKDIR /serai -# Update Rust -RUN rustup update +RUN apt update && apt upgrade -y -# Install Solc @ 0.8.16 -RUN --mount=type=cache,target=/root/.cache/ \ - --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 -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 +# Mount the caches and build +RUN --mount=type=cache,target=/root/.cargo/ \ + --mount=type=cache,target=/serai/target \ + cd processor && \ + cargo build --release --all-features && \ + mkdir /serai/bin && \ + mv /serai/target/release/serai-processor /serai/bin # Prepare Image -FROM ubuntu:latest as image +FROM debian:bullseye-slim as image LABEL description="STAGE 2: Copy and Run" WORKDIR /home/serai # 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 . +# Install openssl +RUN apt update && apt upgrade -y && apt install -y openssl + # Run processor -CMD ["processor"] +CMD ["serai-processor"]