FROM ghcr.io/cross-rs/x86_64-linux-android:0.2.5 as android FROM ubuntu:22.04 COPY --from=android /system/ /system ARG ARCH ENV ARCH="$ARCH" ENV PATH="${PATH}:/rust/bin" ENV RUST_COMPILER_RT_ROOT=/opt/compiler-rt ADD /scripts/install.sh /install.sh ADD /docker/entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh && \ chmod +x /install.sh && \ env ENVFILE=/env.sh /install.sh "${ARCH}" && \ rm -f /install.sh && \ mkdir -p /target && \ apt-get clean autoclean && \ apt-get autoremove --yes && \ rm -rf /var/cache/apt/archives && \ rm -rf /var/lib/apt/lists/* WORKDIR /target ENTRYPOINT ["/entrypoint.sh"] CMD ["/bin/bash"] ENV CC_x86_64_unknown_linux_gnu='x86_64-linux-gnu-gcc' ENV CXX_x86_64_unknown_linux_gnu='x86_64-linux-gnu-g++' ENV AR_x86_64_unknown_linux_gnu='x86_64-linux-gnu-ar' ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER='x86_64-linux-gnu-gcc' ENV CC_x86_64_unknown_linux_musl='x86_64-linux-musl-gcc' ENV CXX_x86_64_unknown_linux_musl='x86_64-linux-musl-g++' ENV AR_x86_64_unknown_linux_musl='x86_64-linux-musl-ar' ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER='x86_64-linux-musl-gcc' ENV CC_x86_64_linux_android='x86_64-linux-android-gcc' ENV CXX_x86_64_linux_android='x86_64-linux-android-g++' ENV AR_x86_64_linux_android='x86_64-linux-android-ar' ENV CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER='x86_64-linux-android-gcc' ENV PATH="${PATH}:/android-ndk/bin"