Skip to content

Commit

Permalink
Merge pull request #175 from njgheorghita/new-dockerfile
Browse files Browse the repository at this point in the history
Add dockerfile
  • Loading branch information
njgheorghita authored Nov 5, 2021
2 parents f3aa4c4 + 77324cf commit 6413c05
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Dockerfile
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"]

0 comments on commit 6413c05

Please # to comment.