Skip to content

Commit 91ae4d9

Browse files
committed
validator_worker - Dockerfile
1 parent 4a894b4 commit 91ae4d9

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
target/
2+
scripts/
3+
node_modules
4+
Dockerfile
5+
docker-compose.yml

Dockerfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
FROM rust:1.40 as builder
2+
3+
4+
5+
WORKDIR /usr/src/app
6+
7+
COPY . .
8+
9+
RUN cargo install --path validator_worker --all-features
10+
11+
WORKDIR /usr/local/bin
12+
13+
RUN cp $CARGO_HOME/bin/validator_worker .
14+
15+
FROM ubuntu:18.04
16+
17+
# `ethereum` or `dummy`
18+
ENV ADAPTER=
19+
20+
# only applicable if you use the `--adapter ethereum`
21+
ENV KEYSTORE_FILE=
22+
ENV KEYSTORE_PWD=
23+
24+
# Only applicable if you use the `--adapter dummy`
25+
ENV DUMMY_IDENTITY=
26+
27+
# If set it will override the configuration file used
28+
ENV CONFIG=
29+
# Defaults to `http://127.0.0.1:8005`
30+
ENV SENTRY_URL=
31+
# Set to any value to run the `validator_worker` in `single tick` mode
32+
# default: `infinite`
33+
ENV SINGLE_TICK=
34+
35+
RUN echo ${KEYSTORE_FILE:+-k $KEYSTORE_FILE} ${SENTRY_URL:+-u $SENTRY_URL}
36+
37+
WORKDIR /usr/local/bin
38+
39+
RUN apt update && apt-get install -y libssl-dev
40+
41+
COPY --from=builder /usr/local/bin/validator_worker .
42+
43+
ENTRYPOINT [ \
44+
"sh", "-c", \
45+
"validator_worker", \
46+
"-a", "${ADAPTER:-ethereum}", \
47+
"${DUMMY_IDENTITY:+-i $DUMMY_IDENTITY}", \
48+
"${KEYSTORE_FILE:+-k $KEYSTORE_FILE}", \
49+
"${SINGLE_TICK:+-t}", \
50+
"${SENTRY_URL:+-u $SENTRY_URL}", "${CONFIG}" \
51+
]

0 commit comments

Comments
 (0)