forked from tfgrid/zosbuilder
- Remove rustup dependency from Dockerfile (not available in Alpine) - Update Rust environment setup to handle both rustup and system Rust - Fix musl-gcc linker configuration for Alpine containers - Support both GitHub Actions (rustup) and Alpine container (system) environments
46 lines
959 B
Docker
46 lines
959 B
Docker
# Zero OS Alpine Initramfs Builder Container
|
|
FROM alpine:3.22
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache \
|
|
build-base \
|
|
rust \
|
|
cargo \
|
|
upx \
|
|
git \
|
|
wget \
|
|
tar \
|
|
gzip \
|
|
xz \
|
|
cpio \
|
|
binutils \
|
|
linux-headers \
|
|
musl-dev \
|
|
pkgconfig \
|
|
openssl-dev \
|
|
bash \
|
|
findutils \
|
|
grep \
|
|
sed \
|
|
coreutils
|
|
|
|
# Install musl-dev for Rust musl targeting (Alpine handles this differently than rustup)
|
|
RUN apk add --no-cache musl-dev
|
|
|
|
# Create non-root user for builds
|
|
RUN adduser -D -s /bin/bash builder && \
|
|
chown -R builder:builder /home/builder
|
|
|
|
# Set working directory
|
|
WORKDIR /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"
|
|
|
|
# Default to builder user
|
|
USER builder
|
|
|
|
CMD ["/bin/bash"] |