From 02a4c23a18dc3f7a21694bf91f9eb6c4c987c09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Landabaso=20D=C3=ADaz?= Date: Tue, 25 Jul 2023 20:56:45 +0200 Subject: [PATCH 1/2] Fix non-working Dockerfile for build process Details: - Initialized git submodules in binaryen installation process. - Altered Rust installation to use the version specified in ./rust-toolchain, instead of the default stable version. - Installed additional components and target using ./rust-toolchain version. - Removed rust-toolchain after installation to maintain a clean working directory. --- Dockerfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 23ee7d0..1b72435 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,7 @@ RUN curl -sSf https://apt.llvm.org/llvm.sh | bash -s -- 12 && \ # Install wasm-opt from binaryen RUN git clone --depth 1 --branch version_114 https://github.com/WebAssembly/binaryen.git /binaryen && \ cd /binaryen && \ + git submodule update --init && \ cmake . && \ make -j$(nproc) && \ make install && \ @@ -50,11 +51,15 @@ RUN git clone --depth 1 --branch version_114 https://github.com/WebAssembly/bina RUN useradd -ms /bin/bash builduser USER builduser -# Install Rust stable +# Install Rust (using ./rust-toolchain version) RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \ - --default-toolchain stable \ - --profile minimal \ - --component clippy,rustfmt,rust-src \ - --target wasm32-unknown-unknown + --profile minimal +# Install additional components and target (using ./rust-toolchain version) +WORKDIR /home/builduser/ +COPY rust-toolchain . +ENV PATH=/home/builduser/.cargo/bin:$PATH +RUN rustup component add clippy rustfmt rust-src +RUN rustup target add wasm32-unknown-unknown +RUN rm rust-toolchain CMD Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & export DISPLAY=':99.0' && bash From 4806572cba9a3d992fde246e7de135aec30689e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Landabaso=20D=C3=ADaz?= Date: Wed, 26 Jul 2023 07:52:56 +0200 Subject: [PATCH 2/2] Refactor Dockerfile: use rust-toolchain file implicitly in the installation process to automatically fetch the correct Rust version, simplifying commands --- Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1b72435..c37ad2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,14 +52,13 @@ RUN useradd -ms /bin/bash builduser USER builduser # Install Rust (using ./rust-toolchain version) -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \ - --profile minimal -# Install additional components and target (using ./rust-toolchain version) WORKDIR /home/builduser/ COPY rust-toolchain . -ENV PATH=/home/builduser/.cargo/bin:$PATH -RUN rustup component add clippy rustfmt rust-src -RUN rustup target add wasm32-unknown-unknown -RUN rm rust-toolchain +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y \ + --default-toolchain $(cat rust-toolchain) \ + --profile minimal \ + --component clippy,rustfmt,rust-src \ + --target wasm32-unknown-unknown \ + && rm rust-toolchain CMD Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & export DISPLAY=':99.0' && bash