forked from eth-educators/eth-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c359fd
commit f3db25d
Showing
7 changed files
with
162 additions
and
47 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
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
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
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
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
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,39 @@ | ||
version: "3" | ||
services: | ||
eth1: | ||
restart: "${RESTART}" | ||
user: ${LOCAL_UID}:${LOCAL_UID} | ||
build: | ||
context: ./openethereum | ||
args: | ||
- BUILD_TARGET=${OE_BUILD_TARGET} | ||
- USER=${OE_USER} | ||
- UID=${LOCAL_UID} | ||
image: openethereum | ||
volumes: | ||
- eth1-data:/var/lib/openethereum | ||
ports: | ||
- ${ETH1_PORT}:${ETH1_PORT}/tcp | ||
- ${ETH1_PORT}:${ETH1_PORT}/udp | ||
expose: | ||
- 8545 | ||
entrypoint: | ||
- openethereum | ||
- --no-ws | ||
- --no-ipc | ||
- --no-secretstore | ||
- --base-path=/var/lib/openethereum | ||
- --jsonrpc-interface=all | ||
- --jsonrpc-apis=net,eth | ||
- --jsonrpc-hosts=all | ||
- --chain=${ETH1_NETWORK} | ||
- --port | ||
- ${ETH1_PORT} | ||
beacon: | ||
depends_on: | ||
- eth1 | ||
eth2: | ||
depends_on: | ||
- eth1 | ||
volumes: | ||
eth1-data: |
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,60 @@ | ||
FROM alpine:edge AS builder | ||
|
||
# show backtraces | ||
ENV RUST_BACKTRACE 1 | ||
|
||
ARG BUILD_TARGET | ||
|
||
RUN apk update && apk add --no-cache \ | ||
build-base \ | ||
cargo \ | ||
cmake \ | ||
eudev-dev \ | ||
linux-headers \ | ||
perl \ | ||
rust \ | ||
git \ | ||
bash | ||
|
||
WORKDIR / | ||
RUN bash -c "git clone https://github.com/openethereum/openethereum.git && cd openethereum && git config advice.detachedHead false && git fetch --all --tags && git checkout ${BUILD_TARGET} && cargo build --release --features final --target x86_64-alpine-linux-musl --verbose && strip target/x86_64-alpine-linux-musl/release/openethereum" | ||
|
||
FROM alpine:edge | ||
|
||
# show backtraces | ||
ENV RUST_BACKTRACE 1 | ||
|
||
ARG USER | ||
ARG UID | ||
|
||
# curl and jq are installed to help create health and readiness checks on Kubernetes | ||
RUN apk update && apk add --no-cache \ | ||
libstdc++ \ | ||
eudev-libs \ | ||
libgcc \ | ||
curl \ | ||
jq | ||
|
||
# See https://stackoverflow.com/a/55757473/12429735RUN | ||
RUN adduser \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--home "/nonexistent" \ | ||
--shell "/sbin/nologin" \ | ||
--no-create-home \ | ||
--uid "${UID}" \ | ||
"${USER}" | ||
|
||
# Create data mount point with permissions | ||
RUN mkdir -p /var/lib/openethereum && chown ${USER}:${USER} /var/lib/openethereum && chmod 700 /var/lib/openethereum | ||
|
||
# Use an unprivileged user. | ||
USER ${USER}:${USER} | ||
|
||
EXPOSE 8080 8545 8180 | ||
|
||
WORKDIR /var/lib/openethereum | ||
|
||
COPY --chown=openethereum:openethereum --from=builder /openethereum/target/x86_64-alpine-linux-musl/release/openethereum /usr/local/bin | ||
|
||
ENTRYPOINT ["openethereum", "--base-path=/var/lib/openethereum"] |