Skip to content

Commit

Permalink
[client] Add dockerfile for client
Browse files Browse the repository at this point in the history
This aleviates the trouble community members have been having with
dependency management, especially with regards to protobuf.
  • Loading branch information
Abhay Bothra authored and calibra-opensource committed Jun 19, 2019
1 parent 9f8eca2 commit ab66c38
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docker/client/client.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
### Build Image ###
FROM debian:stretch as builder

RUN echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list && apt-get update && apt-get install -y protobuf-compiler/stretch-backports cmake golang curl && apt-get clean && rm -r /var/lib/apt/lists/*

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none
ENV PATH "$PATH:/root/.cargo/bin"

WORKDIR /libra
COPY rust-toolchain /libra/rust-toolchain
RUN rustup install $(cat rust-toolchain)

COPY . /libra
RUN cargo build --release -p client

### Production Image ###
FROM debian:stretch

RUN mkdir -p /opt/libra/bin /opt/libra/etc
COPY --from=builder /libra/target/release/client /opt/libra/bin/libra_client
COPY --from=builder /libra/scripts/cli/trusted_peers.config.toml /opt/libra/etc/trusted_peers.config.toml

ENTRYPOINT exec /opt/libra/bin/libra_client
CMD --host ac.testnet.libra.org --port 8000 -s /opt/libra/etc/trusted_peers.config.toml

ARG BUILD_DATE
ARG GIT_REV
ARG GIT_UPSTREAM

LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.vcs-ref=$GIT_REV
LABEL vcs-upstream=$GIT_UPSTREAM

0 comments on commit ab66c38

Please sign in to comment.