Jelajahi Sumber

Merge pull request #2445 from mnaamani/official-rust-docker

Official rust docker image for multi-arch support
Mokhtar Naamani 3 tahun lalu
induk
melakukan
5c9787e5d5
2 mengubah file dengan 8 tambahan dan 4 penghapusan
  1. 6 4
      joystream-node.Dockerfile
  2. 2 0
      setup.sh

+ 6 - 4
joystream-node.Dockerfile

@@ -1,11 +1,13 @@
-FROM liuchong/rustup:nightly AS rustup
-RUN rustup install nightly-2021-03-24
+FROM rust:1.52.1-buster AS rust
+RUN rustup self update
+RUN rustup install nightly-2021-03-24 --force
 RUN rustup default nightly-2021-03-24
 RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-24
+RUN rustup component add --toolchain nightly-2021-03-24 clippy
 RUN apt-get update && \
   apt-get install -y curl git gcc xz-utils sudo pkg-config unzip clang llvm libc6-dev
 
-FROM rustup AS builder
+FROM rust AS builder
 LABEL description="Compiles all workspace artifacts"
 WORKDIR /joystream
 COPY . /joystream
@@ -17,7 +19,7 @@ RUN BUILD_DUMMY_WASM_BINARY=1 cargo clippy --release --all -- -D warnings && \
     cargo test --release --all && \
     cargo build --release
 
-FROM debian:buster
+FROM ubuntu:21.04
 LABEL description="Joystream node"
 WORKDIR /joystream
 COPY --from=builder /joystream/target/release/joystream-node /joystream/node

+ 2 - 0
setup.sh

@@ -17,6 +17,8 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
     brew update
     brew install coreutils gnu-tar jq curl
     echo "It is recommended to setup Docker desktop from: https://www.docker.com/products/docker-desktop"
+    echo "It is also recommended to install qemu emulators with following command:"
+    echo "docker run --privileged --rm tonistiigi/binfmt --install all"
 fi
 
 # If OS is supported will install build tools for rust and substrate.