From 4162fd1aba6a3d4388986cca58b2ce5154ed19d8 Mon Sep 17 00:00:00 2001 From: Luke Schoen Date: Fri, 20 Jul 2018 06:54:01 +0200 Subject: [PATCH] fix: Fix #375 errors by installing git, rustup in PATH and flags to accept defaults --- docker/Dockerfile | 23 ++++++++++++++++------- docker/build.sh | 3 ++- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7eca2af1e0b26..9de9414042e22 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,18 +1,27 @@ +# delete images - docker rmi $(docker images -q) -f +# delete containers - docker rm $(docker ps -a -q) -f + FROM phusion/baseimage:0.10.1 LABEL maintainer "chevdor@gmail.com" +ARG POLKADOT_VERSION=v0.2 RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y cmake pkg-config libssl-dev && \ - curl https://sh.rustup.rs -sSf | sh && \ + curl https://sh.rustup.rs -sSf | sh -s -- -y && \ + echo 'PATH="$/root/.cargo/bin:$PATH";' >> ~/.bash_profile && \ + . ~/.bash_profile && . /root/.cargo/env && \ + which rustup && which cargo && \ rustup update nightly && \ rustup target add wasm32-unknown-unknown --toolchain nightly && \ - rustup update stable && \ - cargo install --git https://github.com/alexcrichton/wasm-gc && \ - git clone https://github.com/paritytech/polkadot.git && \ - cd polkadot && \ - ./build.sh && \ - cargo build + rustup update stable && rustup default stable && \ + cargo install --git https://github.com/alexcrichton/wasm-gc --force && \ + cargo install --git https://github.com/pepyakin/wasm-export-table.git --force && \ + apt-get install -y git vim curl && \ + git clone https://github.com/paritytech/polkadot.git && cd polkadot && \ + git fetch origin ${POLKADOT_VERSION}:${POLKADOT_VERSION} && \ + git checkout ${POLKADOT_VERSION} && \ + ./build.sh && cargo build WORKDIR /polkadot CMD ["/bin/sh", "polkadot"] diff --git a/docker/build.sh b/docker/build.sh index eecacff45d9db..a2728243fd7e4 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -1,3 +1,4 @@ #!/bin/sh -docker build -t polkadot:0.2 . +docker build -t polkadot:0.2 .; +docker run -it polkadot:0.2 bash;