From 1fa0f3b8d5ac41c1bd7b8b0be7e5f023d9442a31 Mon Sep 17 00:00:00 2001 From: Trace Andreason Date: Sun, 21 Feb 2021 16:01:09 -0800 Subject: [PATCH 1/2] adding a dockerfile --- Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..e209c0fd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM ubuntu:focal as builder +LABEL maintainer "who_should_this_be@gmail.com" +LABEL description="This image contains the cargo contract command" + +ARG RUSTC_VERSION="nightly-2020-10-27" +ENV RUSTC_VERSION=$RUSTC_VERSION +ENV PROFILE=release +ENV PACKAGE=polkadot-runtime + +RUN mkdir -p /cargo-home /rustup-home +WORKDIR /build +ENV RUSTUP_HOME="/rustup-home" +ENV CARGO_HOME="/cargo-home" +ENV DEBIAN_FRONTEND="noninteractive" + +# We first init as much as we can in the first layers +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install --no-install-recommends -y \ + cmake pkg-config libssl-dev \ + git clang bsdmainutils jq ca-certificates curl binaryen && \ + curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUSTC_VERSION -y &&\ + rm -rf /var/lib/apt/lists/* + +ENV PATH="/cargo-home/bin:$PATH" +RUN rustup component add rust-src && \ +cargo install --git https://github.com/paritytech/cargo-contract.git --force + +#RUN cargo contract new test -- GitLab From c47a58e48a52a6bfb0180c2167135d1a418a1bf7 Mon Sep 17 00:00:00 2001 From: Trace Andreason Date: Tue, 2 Mar 2021 21:25:31 -0800 Subject: [PATCH 2/2] glue together run commands --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e209c0fd..b7b9faea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ WORKDIR /build ENV RUSTUP_HOME="/rustup-home" ENV CARGO_HOME="/cargo-home" ENV DEBIAN_FRONTEND="noninteractive" +ENV PATH="/cargo-home/bin:$PATH" # We first init as much as we can in the first layers RUN apt-get update && \ @@ -20,10 +21,10 @@ RUN apt-get update && \ cmake pkg-config libssl-dev \ git clang bsdmainutils jq ca-certificates curl binaryen && \ curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUSTC_VERSION -y &&\ - rm -rf /var/lib/apt/lists/* - -ENV PATH="/cargo-home/bin:$PATH" -RUN rustup component add rust-src && \ -cargo install --git https://github.com/paritytech/cargo-contract.git --force + rm -rf /var/lib/apt/lists/* &&\ + rustup toolchain install nightly --target wasm32-unknown-unknown \ + --profile minimal --component rustfmt rust-src; \ + rustup default nightly &&\ + cargo install --git https://github.com/paritytech/cargo-contract.git --force #RUN cargo contract new test -- GitLab