-
Notifications
You must be signed in to change notification settings - Fork 768
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pallet-revive] rpc server add docker file (#6278)
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
1 parent
a42dcbf
commit 3d50716
Showing
3 changed files
with
44 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,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 |
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,7 @@ | ||
doc | ||
**target* | ||
.idea/ | ||
Dockerfile | ||
.dockerignore | ||
.local | ||
.env* |
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,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"] |