-
Notifications
You must be signed in to change notification settings - Fork 53
chore: added Dockerfile's and minor changes to rustfmt.toml #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c15f4d2
Added Docker files and few minor rustfmt changes
ch4r10t33r eb37647
Linted the code
ch4r10t33r cee7f8b
Reran lint
ch4r10t33r 9d01fce
Remove use_small_heuristics configuration
ch4r10t33r eabe059
chore: removed rust-toolchain.toml
ch4r10t33r c5ae567
chore!: added cargo sort to `make lint`
ch4r10t33r 4f588f2
chore: added book/installation.md
ch4r10t33r ab98cb6
chore: corrected Dockerfile.cross
ch4r10t33r 0ecd670
chore: Additional configuration in tomlfmt.toml
ch4r10t33r eed4413
chore!: Amended Makefile for cargo sort configuration
ch4r10t33r 7432166
Merge branch 'master' into master
ch4r10t33r dec362f
chore: Addressed review comments
ch4r10t33r c6fef8d
chore: Addressed review comment
ch4r10t33r 007db38
chore!: removed nightly from Makefile as the toolchain has changed.
ch4r10t33r ca1f4d9
chore: Fixed lint issues
ch4r10t33r 1688ad6
Merge branch 'master' into master
ch4r10t33r cccab86
chore: Fixed linting comment
ch4r10t33r ba4ed52
chore: Fixed lint issue
ch4r10t33r ae7afae
chore!: removed tomlfmt.toml
ch4r10t33r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,18 +1,55 @@ | ||
FROM rust:1.81.0-bullseye AS builder | ||
RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-dev | ||
COPY . ream | ||
ARG FEATURES | ||
ARG PROFILE=release | ||
ARG CARGO_USE_GIT_CLI=true | ||
# syntax=docker.io/docker/dockerfile:1.7-labs | ||
|
||
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef | ||
WORKDIR /app | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/reamlabs/ream | ||
LABEL org.opencontainers.image.description="Ream is a modular, open-source Ethereum beam chain client." | ||
LABEL org.opencontainers.image.licenses="MIT" | ||
ch4r10t33r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config | ||
|
||
# Builds a cargo-chef plan | ||
FROM chef AS planner | ||
COPY --exclude=.git --exclude=dist . . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
FROM chef AS builder | ||
COPY --from=planner /app/recipe.json recipe.json | ||
|
||
# Build profile, release by default | ||
ARG BUILD_PROFILE=release | ||
ENV BUILD_PROFILE=$BUILD_PROFILE | ||
|
||
# Extra Cargo flags | ||
ARG RUSTFLAGS="" | ||
ENV RUSTFLAGS="$RUSTFLAGS" | ||
|
||
# Extra Cargo features | ||
ARG FEATURES="" | ||
ENV FEATURES=$FEATURES | ||
ENV PROFILE=$PROFILE | ||
ENV CARGO_NET_GIT_FETCH_WITH_CLI=$CARGO_USE_GIT_CLI | ||
RUN cd ream && make install | ||
|
||
FROM ubuntu:22.04 | ||
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \ | ||
libssl-dev \ | ||
ca-certificates \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY --from=builder /usr/local/cargo/bin/ream /usr/local/bin/ream | ||
|
||
# Builds dependencies | ||
ch4r10t33r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
RUN cargo chef cook --profile $BUILD_PROFILE --features "$FEATURES" --recipe-path recipe.json | ||
|
||
# Build application | ||
COPY --exclude=.git --exclude=dist . . | ||
RUN cargo build --profile $BUILD_PROFILE --features "$FEATURES" --locked --bin ream | ||
|
||
# ARG is not resolved in COPY so we have to hack around it by copying the | ||
# binary to a temporary location | ||
RUN cp /app/target/$BUILD_PROFILE/ream /app/ream | ||
|
||
# Use Ubuntu as the release image | ||
FROM ubuntu AS runtime | ||
WORKDIR /app | ||
|
||
# Copy reth over from the build stage | ||
COPY --from=builder /app/ream /usr/local/bin | ||
|
||
# Copy licenses | ||
COPY LICENSE-* ./ | ||
ch4r10t33r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
EXPOSE 8545 8546 | ||
ENTRYPOINT ["/usr/local/bin/ream"] | ||
ch4r10t33r marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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
This file contains hidden or 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 from Source | ||
|
||
You can build Ream on Linux. | ||
|
||
## Dependencies | ||
|
||
First install Rust using <a href="https://rustup.rs/">rustup</a>: | ||
|
||
```bash | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
``` | ||
|
||
There are some other dependencies you need to install based on your operating system (OS): | ||
|
||
- **Ubuntu/Debian**: `apt-get install libclang-dev pkg-config libssl-dev build-essential` | ||
|
||
|
||
|
||
## Build Ream | ||
|
||
Clone the repository and move to the directory: | ||
|
||
```bash | ||
git clone [email protected]:reamlabs/ream.git | ||
cd ream | ||
``` | ||
|
||
There are also some other rust tools that you need to install. | ||
|
||
```bash | ||
cargo install cargo-sort | ||
``` | ||
ch4r10t33r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
After everything is setup, you can start the build: | ||
|
||
```bash | ||
make build // cargo build --release | ||
ch4r10t33r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` |
ch4r10t33r marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
ch4r10t33r marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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 |
---|---|---|
@@ -1 +1,4 @@ | ||
# cargo-sort configuration | ||
## https://github.com/DevinR528/cargo-sort | ||
ch4r10t33r marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
key_value_newlines = true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.