Block a user
rust-mute-build (macos-v1.0.0)
Published 2024-11-28 18:01:24 +00:00 by matthias
Installation
docker pull gitea.pb42.de/matthias/rust-mute-build:macos-v1.0.0sha256:a0496b9c182ec74ce9381f349a5d6fa930ea999717c719e05d9d1cddaa6c8188
About this package
Use same Docker image for compiling Rust programs for Linux (musl libc) & macOS (osxcross).
Image Layers
| ADD file:90b9dd8f12120e8b2cd3ece45fcbe8af67e40565e2032a40f64bd921c43e2ce7 in / |
| CMD ["bash"] |
| ARG VERSION=0.0.0 |
| ENV VERSION=0.0.0 |
| LABEL version=0.0.0 description=Use same Docker image for compiling Rust programs for Linux (musl libc) & macOS (osxcross). maintainer=Jose Quintana <joseluisq.net> |
| RUN |1 VERSION=0.0.0 /bin/sh -c set -eux && dpkg --add-architecture armhf && dpkg --add-architecture arm64 && DEBIAN_FRONTEND=noninteractive apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests autoconf automake build-essential ca-certificates clang cmake curl file gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf g++-aarch64-linux-gnu git libbz2-dev libgmp-dev libicu-dev libmpc-dev libmpfr-dev libpq-dev libsqlite3-dev libssl-dev libtool libxml2-dev linux-libc-dev llvm-dev lzma-dev musl-dev musl-dev:armhf musl-dev:arm64 musl-tools patch pkgconf python3 xutils-dev yasm xz-utils zlib1g-dev && apt-get clean && rm -rf /var/lib/apt/lists/* && true # buildkit |
| RUN |1 VERSION=0.0.0 /bin/sh -c set -eux && ln -s "/usr/bin/g++" "/usr/bin/musl-g++" && mkdir -p /root/libs /root/src && true # buildkit |
| ENV PATH=/root/.cargo/bin:/usr/local/musl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| COPY scripts/git-credential-ghtoken /usr/local/bin # buildkit |
| RUN |1 VERSION=0.0.0 /bin/sh -c set -eux && git config --global credential.https://github.com.helper ghtoken && true # buildkit |
| ARG OPENSSL_VERSION=1.1.1w |
| RUN |2 VERSION=0.0.0 OPENSSL_VERSION=1.1.1w /bin/sh -c set -eux && dpkgArch="$(dpkg --print-architecture)" && case "${dpkgArch##*-}" in amd64) config='';; arm64) config='-mno-outline-atomics';; *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; esac && echo "Building OpenSSL ${OPENSSL_VERSION}..." && ls /usr/include/linux && mkdir -p /usr/local/musl/include && ln -s /usr/include/linux /usr/local/musl/include/linux && ln -s "/usr/include/$(uname -m)-linux-gnu/asm" /usr/local/musl/include/asm && ln -s /usr/include/asm-generic /usr/local/musl/include/asm-generic && cd /tmp && ver=$(echo $OPENSSL_VERSION | sed -e 's:\.:_:g') && curl -LO "https://github.com/openssl/openssl/releases/download/OpenSSL_${ver}/openssl-${OPENSSL_VERSION}.tar.gz" && tar xvzf "openssl-${OPENSSL_VERSION}.tar.gz" && cd "openssl-${OPENSSL_VERSION}" && env CC=musl-gcc ./Configure no-shared no-zlib -fPIC --prefix=/usr/local/musl -DOPENSSL_NO_SECURE_MEMORY ${config} "linux-$(uname -m)" && env C_INCLUDE_PATH=/usr/local/musl/include/ make depend && env C_INCLUDE_PATH=/usr/local/musl/include/ make -j$(nproc) && make -j$(nproc) install_sw && make -j$(nproc) install_ssldirs && rm /usr/local/musl/include/linux /usr/local/musl/include/asm /usr/local/musl/include/asm-generic && openssl version && rm -r /tmp/* && true # buildkit |
| ARG ZLIB_VERSION=1.3.1 |
| RUN |3 VERSION=0.0.0 OPENSSL_VERSION=1.1.1w ZLIB_VERSION=1.3.1 /bin/sh -c set -eux && echo "Building zlib ${ZLIB_VERSION}..." && cd /tmp && curl -LO "https://www.zlib.net/fossils/zlib-${ZLIB_VERSION}.tar.gz" && tar xzf "zlib-${ZLIB_VERSION}.tar.gz" && cd "zlib-${ZLIB_VERSION}" && env CC=musl-gcc ./configure --static --prefix=/usr/local/musl && make -j$(nproc) && make -j$(nproc) install && rm -r /tmp/* && true # buildkit |
| ARG POSTGRESQL_VERSION=15.8 |
| RUN |4 VERSION=0.0.0 OPENSSL_VERSION=1.1.1w ZLIB_VERSION=1.3.1 POSTGRESQL_VERSION=15.8 /bin/sh -c set -eux && echo "Building libpq ${POSTGRESQL_VERSION}..." && cd /tmp && curl -LO "https://ftp.postgresql.org/pub/source/v${POSTGRESQL_VERSION}/postgresql-${POSTGRESQL_VERSION}.tar.gz" && tar xzf "postgresql-${POSTGRESQL_VERSION}.tar.gz" && cd "postgresql-${POSTGRESQL_VERSION}" && env CC=musl-gcc CPPFLAGS=-I/usr/local/musl/include LDFLAGS=-L/usr/local/musl/lib ./configure --with-openssl --without-readline --prefix=/usr/local/musl && cd src/interfaces/libpq && make -j$(nproc) all-static-lib && make -j$(nproc) install-lib-static && cd ../../bin/pg_config && make -j$(nproc) && make -j$(nproc) install && rm -r /tmp/* && true # buildkit |
| ENV X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR=/usr/local/musl/ AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR=/usr/local/musl/ X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_STATIC=1 AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_STATIC=1 PQ_LIB_STATIC_X86_64_UNKNOWN_LINUX_MUSL=1 PQ_LIB_STATIC_AARCH64_UNKNOWN_LINUX_MUSL=1 PG_CONFIG_X86_64_UNKNOWN_LINUX_GNU=/usr/bin/pg_config PG_CONFIG_AARCH64_UNKNOWN_LINUX_GNU=/usr/bin/pg_config PKG_CONFIG_ALLOW_CROSS=true PKG_CONFIG_ALL_STATIC=true LIBZ_SYS_STATIC=1 TARGET=musl |
| ARG OSX_SDK_VERSION=13.3 |
| ARG OSX_SDK_SUM=518e35eae6039b3f64e8025f4525c1c43786cc5cf39459d609852faf091e34be |
| ARG OSX_VERSION_MIN=10.14 |
| ARG OSX_CROSS_COMMIT=29fe6dd35522073c9df5800f8cd1feb4b9a993a8 |
| RUN |8 VERSION=0.0.0 OPENSSL_VERSION=1.1.1w ZLIB_VERSION=1.3.1 POSTGRESQL_VERSION=15.8 OSX_SDK_VERSION=13.3 OSX_SDK_SUM=518e35eae6039b3f64e8025f4525c1c43786cc5cf39459d609852faf091e34be OSX_VERSION_MIN=10.14 OSX_CROSS_COMMIT=29fe6dd35522073c9df5800f8cd1feb4b9a993a8 /bin/sh -c set -eux && echo "Cloning osxcross..." && git clone https://github.com/tpoechtrager/osxcross.git /usr/local/osxcross && cd /usr/local/osxcross && git checkout -q "${OSX_CROSS_COMMIT}" && rm -rf ./.git && true # buildkit |
| RUN |8 VERSION=0.0.0 OPENSSL_VERSION=1.1.1w ZLIB_VERSION=1.3.1 POSTGRESQL_VERSION=15.8 OSX_SDK_VERSION=13.3 OSX_SDK_SUM=518e35eae6039b3f64e8025f4525c1c43786cc5cf39459d609852faf091e34be OSX_VERSION_MIN=10.14 OSX_CROSS_COMMIT=29fe6dd35522073c9df5800f8cd1feb4b9a993a8 /bin/sh -c set -eux && echo "Building osxcross with ${OSX_SDK_VERSION}..." && cd /usr/local/osxcross && curl -Lo "./tarballs/MacOSX${OSX_SDK_VERSION}.sdk.tar.xz" "https://github.com/joseluisq/macosx-sdks/releases/download/${OSX_SDK_VERSION}/MacOSX${OSX_SDK_VERSION}.sdk.tar.xz" && echo "${OSX_SDK_SUM} ./tarballs/MacOSX${OSX_SDK_VERSION}.sdk.tar.xz" | sha256sum -c - && env UNATTENDED=yes OSX_VERSION_MIN=${OSX_VERSION_MIN} ./build.sh && true # buildkit |
| RUN |8 VERSION=0.0.0 OPENSSL_VERSION=1.1.1w ZLIB_VERSION=1.3.1 POSTGRESQL_VERSION=15.8 OSX_SDK_VERSION=13.3 OSX_SDK_SUM=518e35eae6039b3f64e8025f4525c1c43786cc5cf39459d609852faf091e34be OSX_VERSION_MIN=10.14 OSX_CROSS_COMMIT=29fe6dd35522073c9df5800f8cd1feb4b9a993a8 /bin/sh -c set -eux && cd /usr/local/osxcross && echo "Building osxcross with compiler-rt..." && env DISABLE_PARALLEL_ARCH_BUILD=1 ./build_compiler_rt.sh && true # buildkit |
| ENV PATH=/root/.cargo/bin:/usr/local/musl/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/osxcross/target/bin |
| ENV MACOSX_DEPLOYMENT_TARGET=10.14 |
| ENV OSXCROSS_MACPORTS_MIRROR=https://packages.macports.org |
| RUN |8 VERSION=0.0.0 OPENSSL_VERSION=1.1.1w ZLIB_VERSION=1.3.1 POSTGRESQL_VERSION=15.8 OSX_SDK_VERSION=13.3 OSX_SDK_SUM=518e35eae6039b3f64e8025f4525c1c43786cc5cf39459d609852faf091e34be OSX_VERSION_MIN=10.14 OSX_CROSS_COMMIT=29fe6dd35522073c9df5800f8cd1feb4b9a993a8 /bin/sh -c set -eux && echo "Testing osxcross with compiler-rt..." && echo "int main(void){return 0;}" | xcrun clang -xc -o/dev/null -v - 2>&1 | grep "libclang_rt" 1>/dev/null && echo "compiler-rt installed and working successfully!" && true # buildkit |
| RUN |8 VERSION=0.0.0 OPENSSL_VERSION=1.1.1w ZLIB_VERSION=1.3.1 POSTGRESQL_VERSION=15.8 OSX_SDK_VERSION=13.3 OSX_SDK_SUM=518e35eae6039b3f64e8025f4525c1c43786cc5cf39459d609852faf091e34be OSX_VERSION_MIN=10.14 OSX_CROSS_COMMIT=29fe6dd35522073c9df5800f8cd1feb4b9a993a8 /bin/sh -c set -eux && echo "Install dependencies via osxcross tools..." && apt-get update && /usr/local/osxcross/tools/get_dependencies.sh && true # buildkit |
| ARG TOOLCHAIN=1.82.0 |
| RUN |9 VERSION=0.0.0 OPENSSL_VERSION=1.1.1w ZLIB_VERSION=1.3.1 POSTGRESQL_VERSION=15.8 OSX_SDK_VERSION=13.3 OSX_SDK_SUM=518e35eae6039b3f64e8025f4525c1c43786cc5cf39459d609852faf091e34be OSX_VERSION_MIN=10.14 OSX_CROSS_COMMIT=29fe6dd35522073c9df5800f8cd1feb4b9a993a8 TOOLCHAIN=1.82.0 /bin/sh -c set -eux && curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=$TOOLCHAIN && rustup target add aarch64-apple-darwin aarch64-unknown-linux-gnu aarch64-unknown-linux-musl armv7-unknown-linux-musleabihf x86_64-apple-darwin x86_64-unknown-linux-musl && true # buildkit |
| COPY cargo/config.toml /root/.cargo/config # buildkit |
| RUN |9 VERSION=0.0.0 OPENSSL_VERSION=1.1.1w ZLIB_VERSION=1.3.1 POSTGRESQL_VERSION=15.8 OSX_SDK_VERSION=13.3 OSX_SDK_SUM=518e35eae6039b3f64e8025f4525c1c43786cc5cf39459d609852faf091e34be OSX_VERSION_MIN=10.14 OSX_CROSS_COMMIT=29fe6dd35522073c9df5800f8cd1feb4b9a993a8 TOOLCHAIN=1.82.0 /bin/sh -c set -eux && echo "Removing temp files..." && rm -rf *~ taballs *.tar.xz && rm -rf /tmp/* && true # buildkit |
| WORKDIR /root/src |
| CMD ["bash"] |
| LABEL org.opencontainers.image.vendor=Jose Quintana org.opencontainers.image.url=https://github.com/joseluisq/rust-linux-darwin-builder org.opencontainers.image.title=Rust Linux / Darwin Builder org.opencontainers.image.description=Use same Docker image for compiling Rust programs for Linux (musl libc) & macOS (osxcross). org.opencontainers.image.version=0.0.0 org.opencontainers.image.documentation=https://github.com/joseluisq/rust-linux-darwin-builder |
| ENV TARGET=x86_64-apple-darwin |
| ENV CC=o64-clang |
| ENV CXX=o64-clang++ |
| /bin/sh -c rustup target add $TARGET |
| LABEL org.opencontainers.image.created=2024-11-28T17:50:54Z |
| LABEL org.opencontainers.image.revision=e4f154b9e5c3952d9962782747629f5af23116f0 |
| LABEL org.opencontainers.image.source=https://gitea.pb42.de/mutenix/build-docker.git |
| LABEL org.opencontainers.image.url=https://gitea.pb42.de/mutenix/build-docker |
Labels
| Key | Value |
|---|---|
| description | Use same Docker image for compiling Rust programs for Linux (musl libc) & macOS (osxcross). |
| maintainer | Jose Quintana <joseluisq.net> |
| org.opencontainers.image.created | 2024-11-28T17:50:54Z |
| org.opencontainers.image.description | Use same Docker image for compiling Rust programs for Linux (musl libc) & macOS (osxcross). |
| org.opencontainers.image.documentation | https://github.com/joseluisq/rust-linux-darwin-builder |
| org.opencontainers.image.revision | e4f154b9e5c3952d9962782747629f5af23116f0 |
| org.opencontainers.image.source | https://gitea.pb42.de/mutenix/build-docker.git |
| org.opencontainers.image.title | Rust Linux / Darwin Builder |
| org.opencontainers.image.url | https://gitea.pb42.de/mutenix/build-docker |
| org.opencontainers.image.vendor | Jose Quintana |
| org.opencontainers.image.version | 0.0.0 |
| version | 0.0.0 |
Details
2024-11-28 18:01:24 +00:00
Versions (5)
View all
Container
1
OCI / Docker
linux/amd64
2.0 GiB
macos-v1.0.0
2024-11-28
windows-v1.0.0
2024-11-28
macos
2024-11-27
windows
2024-11-27
latest
2024-11-26