2021-01-19 10:59:40 +01:00
|
|
|
FROM alpine:3.12.3 AS builder
|
2018-08-10 10:45:04 +02:00
|
|
|
|
|
|
|
# show backtraces
|
|
|
|
ENV RUST_BACKTRACE 1
|
|
|
|
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
build-base \
|
|
|
|
cargo \
|
|
|
|
cmake \
|
|
|
|
eudev-dev \
|
|
|
|
linux-headers \
|
|
|
|
perl \
|
2020-09-22 14:53:52 +02:00
|
|
|
rust \
|
|
|
|
git
|
2018-05-09 23:28:16 +02:00
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
WORKDIR /openethereum
|
|
|
|
COPY . /openethereum
|
|
|
|
RUN cargo build --release --features final --target x86_64-alpine-linux-musl --verbose
|
|
|
|
RUN strip target/x86_64-alpine-linux-musl/release/openethereum
|
2018-08-10 10:45:04 +02:00
|
|
|
|
2021-01-19 10:59:40 +01:00
|
|
|
FROM alpine:3.12.3
|
2018-05-09 23:28:16 +02:00
|
|
|
|
|
|
|
# show backtraces
|
|
|
|
ENV RUST_BACKTRACE 1
|
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
# curl and jq are installed to help create health and readiness checks on Kubernetes
|
2018-08-10 10:45:04 +02:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
libstdc++ \
|
|
|
|
eudev-libs \
|
2020-09-22 14:53:52 +02:00
|
|
|
libgcc \
|
|
|
|
curl \
|
|
|
|
jq
|
2018-05-09 23:28:16 +02:00
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
RUN addgroup -g 1000 openethereum \
|
|
|
|
&& adduser -u 1000 -G openethereum -s /bin/sh -D openethereum
|
2018-05-09 23:28:16 +02:00
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
USER openethereum
|
2018-05-09 23:28:16 +02:00
|
|
|
|
|
|
|
EXPOSE 8080 8545 8180
|
2018-08-10 10:45:04 +02:00
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
WORKDIR /home/openethereum
|
2018-08-10 10:45:04 +02:00
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
RUN mkdir -p /home/openethereum/.local/share/io.parity.ethereum/
|
|
|
|
COPY --chown=openethereum:openethereum --from=builder /openethereum/target/x86_64-alpine-linux-musl/release/openethereum ./
|
2018-08-10 10:45:04 +02:00
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
ENTRYPOINT ["/home/openethereum/openethereum"]
|