polkadot collator builder (#740)

* dockerfiles: polkadot-collator_builder.Containerfile and docs

* dockerfiles: optimize test dockerfile
This commit is contained in:
Denis Pisarev
2021-11-11 13:57:57 +01:00
committed by GitHub
parent d4045c85e7
commit 7100363a35
3 changed files with 60 additions and 31 deletions
+4 -19
View File
@@ -1,23 +1,8 @@
FROM rust:buster as builder
# This file is sourced from https://github.com/paritytech/polkadot/blob/master/scripts/dockerfiles/polkadot/polkadot_builder.Dockerfile
FROM docker.io/paritytech/ci-linux:production as builder
RUN apt-get update && apt-get install time clang libclang-dev llvm -y
RUN rustup toolchain install nightly
RUN rustup target add wasm32-unknown-unknown --toolchain nightly
RUN command -v wasm-gc || cargo +nightly install --git https://github.com/alexcrichton/wasm-gc --force
WORKDIR /paritytech/cumulus
# Ideally, we could just do something like `COPY . .`, but that doesn't work:
# it busts the cache every time non-source files like inject_bootnodes.sh change,
# as well as when non-`.dockerignore`'d transient files (*.log and friends)
# show up. There is no way to exclude particular files, or write a negative
# rule, using Docker's COPY syntax, which derives from go's filepath.Match rules.
#
# We can't combine these into a single big COPY operation like
# `COPY collator consensus network runtime test Cargo.* .`, because in that case
# docker will copy the _contents_ of each directory into the image workdir,
# not the actual directory. We're stuck just enumerating them.
COPY . .
WORKDIR /cumulus
COPY . /cumulus
RUN cargo build --release --locked -p polkadot-collator