-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from njgheorghita/new-dockerfile
Add dockerfile
- Loading branch information
Showing
1 changed file
with
30 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,30 @@ | ||
# select build image | ||
FROM rust:1.56.1 AS builder | ||
|
||
# create a new empty shell project | ||
RUN USER=root cargo new --bin trin | ||
WORKDIR /trin | ||
|
||
RUN apt-get update && apt-get install clang -y | ||
|
||
# copy over manifests and source to build image | ||
COPY ./Cargo.lock ./Cargo.lock | ||
COPY ./Cargo.toml ./Cargo.toml | ||
COPY ./src ./src | ||
COPY ./trin-core ./trin-core | ||
COPY ./trin-history ./trin-history | ||
COPY ./trin-state ./trin-state | ||
COPY ./ethportal-peertest ./ethportal-peertest | ||
|
||
# build for release | ||
RUN cargo build --release | ||
|
||
# final base | ||
FROM rust:1.56.1 | ||
|
||
# copy build artifact from build stage | ||
COPY --from=builder /trin/target/release/trin . | ||
|
||
ENV RUST_LOG=debug | ||
|
||
ENTRYPOINT ["./trin"] |