From 228c97ad85a4dd1de530804a18d293f315a97df3 Mon Sep 17 00:00:00 2001 From: debris Date: Wed, 5 Apr 2017 16:27:32 +0700 Subject: [PATCH] basic docker setup --- .dockerignore | 23 +++++++++++++++++++++++ docker/ubuntu/Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ tools/docker_build.sh | 3 +++ 3 files changed, 65 insertions(+) create mode 100644 .dockerignore create mode 100644 docker/ubuntu/Dockerfile create mode 100755 tools/docker_build.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..10f3b88c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,23 @@ +# Generated by Cargo +# will have compiled files and executables +target + +*.swp +*.swo +*.swn +*.DS_Store + +# Visual Studio Code stuff +.vscode + +# GitEye stuff +.project + +# idea ide +.idea + +# git stuff +.git + +# ignore compare tools +tools/compare-tool diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile new file mode 100644 index 00000000..05675b91 --- /dev/null +++ b/docker/ubuntu/Dockerfile @@ -0,0 +1,39 @@ +FROM ubuntu:14.04 +WORKDIR /build +ADD . /build/pbtc + +# install tools and dependencies +RUN apt-get update && \ + apt-get install -y \ + g++ \ + build-essential \ + curl \ + git \ + file \ + binutils \ + libssl-dev \ + pkg-config \ + libudev-dev + +# install rustup +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y + +# rustup directory +ENV PATH /root/.cargo/bin:$PATH + +# show backtraces +ENV RUST_BACKTRACE 1 + +# show tools +RUN rustc -vV && \ +cargo -V && \ +gcc -v &&\ +g++ -v + +# build pbtc +RUN cd pbtc && cargo build --release --verbose + +RUN file /build/pbtc/target/release/pbtc + +EXPOSE 8333 18333 8332 18332 +ENTRYPOINT ["/build/pbtc/target/release/pbtc"] diff --git a/tools/docker_build.sh b/tools/docker_build.sh new file mode 100755 index 00000000..c98f3013 --- /dev/null +++ b/tools/docker_build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker build --force-rm -t pbtc-ubuntu -f docker/ubuntu/Dockerfile .