-
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
Showing
3 changed files
with
40 additions
and
22 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 @@ | ||
**/target |
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 |
---|---|---|
@@ -1,42 +1,48 @@ | ||
# Stage 1 - Build | ||
|
||
FROM golang:1.14-buster as builder | ||
FROM bitwyre/native-builder:latest as builder | ||
WORKDIR /app/parity | ||
|
||
COPY go-ethereum /app/src/go-ethereum | ||
WORKDIR /app/src/go-ethereum | ||
# YASM | ||
COPY yasm yasm | ||
RUN cd yasm && \ | ||
./autogen.sh && \ | ||
./configure && \ | ||
make -j4 install | ||
|
||
RUN apt-get update && apt-get install -y build-essential | ||
RUN echo "\nSubmodule files:"&& \ | ||
ls -Falg --group-directories-first && \ | ||
echo && \ | ||
gcc --version && \ | ||
make -j$(nproc) geth | ||
RUN cd /app/src/go-ethereum/build && \ | ||
ls -Falg --group-directories-first && \ | ||
strip bin/geth | ||
# Open-Ethereum | ||
COPY openethereum openethereum | ||
WORKDIR /app/parity/openethereum | ||
ENV PATH /root/.cargo/bin:/usr/lib/llvm-10/bin:$PATH | ||
RUN RUSTFLAGS="-C link-args=-s -C codegen-units=1" cargo build --release --features final && \ | ||
echo "\nBinary info:" && file target/release/parity && size target/release/parity | ||
|
||
|
||
# Stage 2 - Production Image | ||
|
||
FROM ubuntu:18.04 | ||
|
||
LABEL maintainer "Yefta Sutanto <[email protected]>" | ||
LABEL maintainer "Yefta Sutanto ([email protected]), Aditya Kresna ([email protected])" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends gosu && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
groupadd -r ethereum && useradd -r -m -g ethereum ethereum | ||
RUN mkdir -p /home/ethereum/.ethereum && \ | ||
RUN mkdir -p /home/ethereum/.local/share/io.parity.ethereum && \ | ||
chown -R ethereum:ethereum /home/ethereum | ||
|
||
COPY --from=builder /app/src/go-ethereum/build/bin /usr/local/bin | ||
COPY --from=builder /app/parity/openethereum/target/release/parity /usr/local/bin/parity | ||
COPY testnet-config.toml /home/ethereum/.local/share/io.parity.ethereum/config.toml | ||
COPY docker-entrypoint.sh /docker-entrypoint.sh | ||
RUN chmod +x /docker-entrypoint.sh | ||
|
||
VOLUME ["/home/ethereum/.ethereum"] | ||
EXPOSE 8545 8546 8547 30303 30303/udp | ||
RUN chmod +x /docker-entrypoint.sh && \ | ||
# Take ownership once again | ||
chown -R ethereum:ethereum /home/ethereum | ||
|
||
VOLUME ["/home/ethereum/.local/share/io.parity.ethereum"] | ||
EXPOSE 8082 8083 8545 8546 8547 30303 30303/udp | ||
|
||
ENV ETHEREUM_DATA "/home/ethereum/.ethereum" | ||
ENV ETHEREUM_DATA "/home/ethereum/.local/share/io.parity.ethereum" | ||
|
||
ENTRYPOINT ["/./docker-entrypoint.sh"] | ||
CMD ["geth"] | ||
CMD ["parity"] |
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