-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clients/reth: Dockerfile support to build Reth from git or locally (#860
- Loading branch information
1 parent
da792c2
commit ce4be72
Showing
2 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
### Build Reth From Git: | ||
## Pulls reth from a git repository and builds it from source. | ||
|
||
## Builder stage: Compiles reth from a git repository | ||
FROM rust:latest as builder | ||
|
||
ARG github=paradigmxyz/reth | ||
ARG tag=main | ||
|
||
RUN apt-get update && apt-get install -y libclang-dev pkg-config build-essential \ | ||
&& echo "Cloning: $github - $tag" \ | ||
&& git clone --depth 1 --branch $tag https://github.com/$github reth \ | ||
&& cd reth && cargo build --release \ | ||
&& cp target/release/reth /usr/local/bin/reth | ||
|
||
## Final stage: Sets up the environment for running reth | ||
FROM debian:latest | ||
RUN apt-get update && apt-get install -y bash curl jq \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy compiled binary from builder | ||
COPY --from=builder /usr/local/bin/reth /usr/local/bin/reth | ||
|
||
# Add genesis mapper script, startup script, and enode URL retriever script | ||
COPY genesis.json /genesis.json | ||
COPY mapper.jq /mapper.jq | ||
COPY reth.sh /reth.sh | ||
COPY enode.sh /hive-bin/enode.sh | ||
|
||
# Set execute permissions for scripts | ||
RUN chmod +x /reth.sh /hive-bin/enode.sh | ||
|
||
# Create version.txt | ||
RUN /usr/local/bin/reth --version | head -1 > /version.txt | ||
|
||
# Export the usual networking ports | ||
EXPOSE 8545 8546 30303 30303/udp | ||
|
||
ENTRYPOINT ["/reth.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
### Build Reth Locally: | ||
## Requires a copy of <reth>/ -> hive/clients/reth/<reth> | ||
|
||
## Builder stage: Compiles reth from a git repository | ||
FROM rust:latest as builder | ||
|
||
# Default local client path: clients/reth/<reth> | ||
ARG local_path=reth | ||
COPY $local_path reth | ||
|
||
RUN apt-get update && apt-get install -y libclang-dev pkg-config build-essential \ | ||
&& cd reth && cargo build --release \ | ||
&& cp target/release/reth /usr/local/bin/reth | ||
|
||
## Final stage: Sets up the environment for running reth | ||
FROM debian:latest | ||
RUN apt-get update && apt-get install -y bash curl jq \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy compiled binary from builder | ||
COPY --from=builder /usr/local/bin/reth /usr/local/bin/reth | ||
|
||
# Add genesis mapper script, startup script, and enode URL retriever script | ||
COPY genesis.json /genesis.json | ||
COPY mapper.jq /mapper.jq | ||
COPY reth.sh /reth.sh | ||
COPY enode.sh /hive-bin/enode.sh | ||
|
||
# Set execute permissions for scripts | ||
RUN chmod +x /reth.sh /hive-bin/enode.sh | ||
|
||
# Create version.txt | ||
RUN /usr/local/bin/reth --version | head -1 > /version.txt | ||
|
||
# Export the usual networking ports | ||
EXPOSE 8545 8546 30303 30303/udp | ||
|
||
ENTRYPOINT ["/reth.sh"] |