Skip to content
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

[pallet-revive] rpc server add docker file #6278

Merged
merged 4 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Loading