mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
1bd19d8511
* Improve docker image size with a 2 stages image * Minor doc updates * Fix and reduce size of the docker image * Fix paths in scripts
39 lines
1.0 KiB
Docker
39 lines
1.0 KiB
Docker
FROM phusion/baseimage:0.10.1 as builder
|
|
LABEL maintainer "chevdor@gmail.com"
|
|
LABEL description="This is the build stage for Polkadot. Here we create the binary."
|
|
|
|
ARG PROFILE=release
|
|
WORKDIR /polkadot
|
|
|
|
COPY . /polkadot
|
|
|
|
RUN apt-get update && \
|
|
apt-get upgrade -y && \
|
|
apt-get install -y cmake pkg-config libssl-dev git
|
|
|
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
|
|
export PATH=$PATH:$HOME/.cargo/bin && \
|
|
cargo build --$PROFILE
|
|
|
|
# ===== SECOND STAGE ======
|
|
|
|
FROM phusion/baseimage:0.10.0
|
|
LABEL maintainer "chevdor@gmail.com"
|
|
LABEL description="This is the 2nd stage: a very small image where we copy the Polkadot binary."
|
|
ARG PROFILE=release
|
|
COPY --from=builder /polkadot/target/$PROFILE/polkadot /usr/local/bin
|
|
|
|
RUN mv /usr/share/ca* /tmp && \
|
|
rm -rf /usr/share/* && \
|
|
mv /tmp/ca-certificates /usr/share/ && \
|
|
rm -rf /usr/lib/python* && \
|
|
mkdir -p /root/.local/share/Polkadot && \
|
|
ln -s /root/.local/share/Polkadot /data
|
|
|
|
RUN rm -rf /usr/bin /usr/sbin
|
|
|
|
EXPOSE 30333 9933 9944
|
|
VOLUME ["/data"]
|
|
|
|
CMD ["/usr/local/bin/polkadot"]
|