-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
ARG AUTHOR="[email protected] <Kirill Azovtsev>" | ||
|
||
ARG BASE_IMAGE | ||
ARG BASE_IMAGE_TAG | ||
ARG ARCHITECTURE=x86_64 | ||
ARG SCCACHE_VERSION | ||
|
||
ARG SCCACHE_VERSION | ||
ARG POLKADOT_SDK_RELEASE | ||
ARG RUST_IMAGE | ||
ARG RUST_IMAGE_TAG | ||
ARG RUST_VERSION | ||
|
||
FROM ${RUST_IMAGE}:${RUST_IMAGE_TAG} AS polkadot-sdk-builder | ||
FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} AS polkadot-sdk-builder | ||
|
||
ARG AUTHOR | ||
ENV AUTHOR=${AUTHOR} | ||
|
@@ -17,23 +18,31 @@ LABEL org.opencontainers.image.description="Polkadot SDK builder image" | |
WORKDIR /home/nonroot/ | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
COPY install_packages /usr/sbin/install_packages | ||
RUN chmod 0755 /usr/sbin/install_packages | ||
|
||
ARG POLKADOT_SDK_RELEASE | ||
ENV POLKADOT_SDK_RELEASE=$POLKADOT_SDK_RELEASE | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends --yes \ | ||
git \ | ||
wget \ | ||
openssl \ | ||
ca-certificates \ | ||
build-essential \ | ||
clang \ | ||
protobuf-compiler \ | ||
libprotobuf-dev && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
RUN rustup default stable && \ | ||
RUN install_packages \ | ||
git \ | ||
wget \ | ||
curl \ | ||
openssl \ | ||
ca-certificates \ | ||
build-essential \ | ||
clang \ | ||
protobuf-compiler \ | ||
libprotobuf-dev | ||
|
||
ARG RUST_VERSION | ||
ENV RUST_VERSION=${RUST_VERSION} | ||
ENV RUSTUP_HOME=/root/.rustup | ||
ENV CARGO_HOME=/root/.cargo | ||
ENV PATH="${CARGO_HOME}/bin:${PATH}" | ||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain ${RUST_VERSION} | ||
|
||
RUN rustup default ${RUST_VERSION} && \ | ||
rustup target add wasm32-unknown-unknown && \ | ||
rustup component add rust-src | ||
|
||
|
@@ -44,10 +53,12 @@ ENV SCCACHE_VERSION=$SCCACHE_VERSION | |
ARG ARCHITECTURE | ||
ENV ARCHITECTURE=$ARCHITECTURE | ||
|
||
RUN mkdir -p /tmp/download | ||
|
||
WORKDIR /tmp/download | ||
|
||
# Version >0.7.4 has a bug - work with GCS is broken | ||
RUN mkdir -p /tmp/download && \ | ||
cd /tmp/download && \ | ||
wget -q -O sccache.tar.gz https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-${ARCHITECTURE}-unknown-linux-musl.tar.gz && \ | ||
RUN wget -q -O sccache.tar.gz https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-${ARCHITECTURE}-unknown-linux-musl.tar.gz && \ | ||
tar xzf sccache.tar.gz && \ | ||
ls -la && \ | ||
mv sccache-v*/sccache /usr/local/bin/sccache && \ | ||
|