2017-10-18 11:22:51 -07:00
|
|
|
# This Dockerfile uses Docker Multi-Stage Builds
|
|
|
|
# See https://docs.docker.com/engine/userguide/eng-image/multistage-build/
|
|
|
|
|
|
|
|
# Build image
|
|
|
|
FROM rust:1.21-jessie AS build
|
|
|
|
|
2017-05-12 07:31:20 -07:00
|
|
|
#ENV for build TAG
|
|
|
|
ARG BUILD_TAG
|
2017-10-18 11:22:51 -07:00
|
|
|
ENV BUILD_TAG=${BUILD_TAG:-master} \
|
|
|
|
PATH=/root/.cargo/bin:$PATH \
|
|
|
|
RUST_BACKTRACE=1
|
|
|
|
|
|
|
|
WORKDIR /build
|
2017-05-12 07:31:20 -07:00
|
|
|
RUN echo $BUILD_TAG
|
2017-10-18 11:22:51 -07:00
|
|
|
|
2017-05-12 07:31:20 -07:00
|
|
|
# install tools and dependencies
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --force-yes --no-install-recommends \
|
|
|
|
g++ \
|
|
|
|
build-essential \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
file \
|
|
|
|
binutils \
|
2017-05-12 10:36:22 -07:00
|
|
|
ca-certificates \
|
2017-05-12 07:31:20 -07:00
|
|
|
libssl-dev \
|
|
|
|
pkg-config \
|
2017-10-18 11:22:51 -07:00
|
|
|
libudev-dev
|
|
|
|
|
2017-05-12 07:31:20 -07:00
|
|
|
# build pbtc-ubuntu
|
2017-10-18 11:22:51 -07:00
|
|
|
RUN git clone https://github.com/paritytech/parity-bitcoin
|
|
|
|
|
|
|
|
WORKDIR /build/parity-bitcoin
|
|
|
|
RUN git pull
|
|
|
|
RUN git checkout $BUILD_TAG
|
|
|
|
RUN cargo build --verbose --release
|
|
|
|
RUN strip /build/parity-bitcoin/target/release/pbtc
|
|
|
|
RUN file /build/parity-bitcoin/target/release/pbtc
|
|
|
|
|
|
|
|
# Runtime image, copies pbtc artifact from build image
|
|
|
|
FROM ubuntu:16.04 AS run
|
|
|
|
LABEL maintainer "Parity Technologies <devops@parity.io>"
|
|
|
|
|
|
|
|
WORKDIR /pbtc-ubuntu
|
|
|
|
COPY --from=build /build/parity-bitcoin/target/release/pbtc/ /pbtc-ubuntu/pbtc-ubuntu
|
|
|
|
|
2017-05-12 07:31:20 -07:00
|
|
|
# setup ENTRYPOINT
|
|
|
|
EXPOSE 8333 18333 8332 18332
|
|
|
|
ENTRYPOINT ["/pbtc-ubuntu/pbtc-ubuntu"]
|