diff --git a/mk/podman.mk b/mk/podman.mk index 044912c59..0dc683f2c 100644 --- a/mk/podman.mk +++ b/mk/podman.mk @@ -73,6 +73,7 @@ ifeq ($(PODMAN_BUILD),1) mkdir -p $(PODMAN_HOME) @echo "Building Podman image. This may take some time." cat $(CONTAINERFILE) | podman build --file - $(PODMAN_VOLUMES) $(PODMAN_CACHE) --tag $(IMAGE_TAG) + $(PODMAN_RUN) bash -e podman/rustinstall.sh mkdir -p build touch $@ @echo "Podman ready!" diff --git a/podman/redox-base-containerfile b/podman/redox-base-containerfile index 1b77e7a41..7b058fc4c 100644 --- a/podman/redox-base-containerfile +++ b/podman/redox-base-containerfile @@ -84,20 +84,3 @@ RUN apt-get update \ libc6-dev-i386 \ syslinux-utils \ ; fi - -RUN echo "Installing rust..." && \ - curl "https://sh.rustup.rs" -sSf | sh -s -- -y --default-toolchain stable --profile minimal - -RUN echo "Downloading sccache..." && \ - SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-$(uname -m)-unknown-linux-musl.tar.gz" && \ - wget -qO- --show-progress "${SCCACHE_URL}" | tar -xz -C ~/.cargo/bin --strip-components=1 --wildcards '*/sccache' - -RUN echo "Downloading just..." && \ - JUST_URL="https://github.com/casey/just/releases/download/1.45.0/just-1.45.0-$(uname -m)-unknown-linux-musl.tar.gz" && \ - wget -qO- --show-progress "${JUST_URL}" | tar -xz -C ~/.cargo/bin --wildcards 'just' - -RUN echo "Downloading cbindgen..." && \ - CBINDGEN_NAME="$( [ "$(uname -m)" = "x86_64" ] && echo "ubuntu22.04" || echo "ubuntu22.04-aarch64" )" && \ - CBINDGEN_URL="https://github.com/mozilla/cbindgen/releases/download/0.29.0/cbindgen-${CBINDGEN_NAME}" && \ - wget -qO- --show-progress "${CBINDGEN_URL}" > ~/.cargo/bin/cbindgen && \ - chmod +x ~/.cargo/bin/cbindgen diff --git a/podman/rustinstall.sh b/podman/rustinstall.sh new file mode 100755 index 000000000..78e475cb9 --- /dev/null +++ b/podman/rustinstall.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# This must be run outside podman build so the build/podman volume mount to /root contains all home folder changes +set -ex + +echo "Installing rust..." +curl "https://sh.rustup.rs" -sSf | sh -s -- -y --default-toolchain stable --profile minimal + +echo "Downloading sccache..." +SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v0.10.0/sccache-v0.10.0-$(uname -m)-unknown-linux-musl.tar.gz" +wget -qO- --show-progress "${SCCACHE_URL}" | tar -xz -C ~/.cargo/bin --strip-components=1 --wildcards '*/sccache' + +echo "Downloading just..." +JUST_URL="https://github.com/casey/just/releases/download/1.45.0/just-1.45.0-$(uname -m)-unknown-linux-musl.tar.gz" +wget -qO- --show-progress "${JUST_URL}" | tar -xz -C ~/.cargo/bin --wildcards 'just' + +echo "Downloading cbindgen..." +CBINDGEN_NAME="$( [ "$(uname -m)" = "x86_64" ] && echo "ubuntu22.04" || echo "ubuntu22.04-aarch64" )" +CBINDGEN_URL="https://github.com/mozilla/cbindgen/releases/download/0.29.0/cbindgen-${CBINDGEN_NAME}" +wget -qO- --show-progress "${CBINDGEN_URL}" > ~/.cargo/bin/cbindgen +chmod +x ~/.cargo/bin/cbindgen