- Fix build_zinit to cd to correct component directory - Add proper working directory logging - Fix branch names for ThreeFold components - Prepare for successful Rust compilation
49 lines
1.1 KiB
Docker
49 lines
1.1 KiB
Docker
# Zero OS Alpine Initramfs Builder Container
|
|
FROM alpine:3.22
|
|
|
|
# Install build dependencies including proper musl toolchain
|
|
RUN apk add --no-cache \
|
|
build-base \
|
|
rust \
|
|
cargo \
|
|
upx \
|
|
git \
|
|
wget \
|
|
tar \
|
|
gzip \
|
|
xz \
|
|
cpio \
|
|
binutils \
|
|
linux-headers \
|
|
musl-dev \
|
|
musl-utils \
|
|
pkgconfig \
|
|
openssl-dev \
|
|
bash \
|
|
findutils \
|
|
grep \
|
|
sed \
|
|
coreutils
|
|
|
|
# Create musl-gcc wrapper (Alpine's gcc already targets musl)
|
|
RUN echo '#!/bin/sh' > /usr/bin/musl-gcc && \
|
|
echo 'exec gcc -static "$@"' >> /usr/bin/musl-gcc && \
|
|
chmod +x /usr/bin/musl-gcc && \
|
|
which musl-gcc
|
|
|
|
# Create non-root user for builds matching host user
|
|
RUN adduser -D -s /bin/bash builder
|
|
|
|
# Set working directory with proper permissions
|
|
WORKDIR /workspace
|
|
RUN chown builder:builder /workspace
|
|
|
|
# Set environment variables for musl static linking with Alpine's Rust
|
|
ENV RUSTFLAGS="-C target-feature=+crt-static -C linker=musl-gcc"
|
|
ENV CC="musl-gcc"
|
|
ENV TARGET_CC="musl-gcc"
|
|
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER="musl-gcc"
|
|
|
|
# Don't switch to builder user yet - let the runtime handle it
|
|
|
|
CMD ["/bin/bash"] |