Skip to content

Commit

Permalink
[pallet-revive] rpc server add docker file (#6278)
Browse files Browse the repository at this point in the history
Add a docker for pallet-revive eth-rpc

 Tested with 
```
sudo docker build . -t eth-rpc -f substrate/frame/revive/rpc/Dockerfile
sudo docker run --network="host" -e RUST_LOG="info,eth-rpc=debug" eth-rpc
```

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Alexander Theißen <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent a42dcbf commit 3d50716
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
14 changes: 14 additions & 0 deletions prdoc/pr_6278.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title: '[pallet-revive] rpc server add docker file'
doc:
- audience: Runtime Dev
description: |-
Add a docker for pallet-revive eth-rpc

Tested with
```
sudo docker build . -t eth-rpc -f substrate/frame/revive/rpc/Dockerfile
sudo docker run --network="host" -e RUST_LOG="info,eth-rpc=debug" eth-rpc
```
crates:
- name: pallet-revive-eth-rpc
bump: minor
7 changes: 7 additions & 0 deletions substrate/frame/revive/rpc/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
doc
**target*
.idea/
Dockerfile
.dockerignore
.local
.env*
23 changes: 23 additions & 0 deletions substrate/frame/revive/rpc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM rust AS builder

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
protobuf-compiler

WORKDIR /polkadot
COPY . /polkadot
RUN cargo build --locked --profile production -p pallet-revive-eth-rpc --bin eth-rpc

FROM docker.io/parity/base-bin:latest
COPY --from=builder /polkadot/target/production/eth-rpc /usr/local/bin

USER root
RUN useradd -m -u 1001 -U -s /bin/sh -d /polkadot polkadot && \
# unclutter and minimize the attack surface
rm -rf /usr/bin /usr/sbin && \
# check if executable works in this container
/usr/local/bin/eth-rpc --help

USER polkadot
EXPOSE 8545
ENTRYPOINT ["/usr/local/bin/eth-rpc"]

0 comments on commit 3d50716

Please sign in to comment.