Initial commit: Alpine Zero-OS initramfs build system with cleaned Docker configuration
This commit is contained in:
71
build/Dockerfile.alpine
Normal file
71
build/Dockerfile.alpine
Normal file
@@ -0,0 +1,71 @@
|
||||
# Alpine-based Zero-OS Initramfs Builder
|
||||
FROM alpine:3.22
|
||||
|
||||
# Set build arguments
|
||||
ARG TARGETARCH=amd64
|
||||
ARG BUILDMODE=debug
|
||||
ARG MINIMAL_MODE=false
|
||||
|
||||
# Set environment variables
|
||||
ENV BUILDMODE=${BUILDMODE}
|
||||
ENV TARGETARCH=${TARGETARCH}
|
||||
ENV MINIMAL_MODE=${MINIMAL_MODE}
|
||||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
# Install build dependencies
|
||||
RUN apk add --no-cache \
|
||||
# Build tools
|
||||
build-base \
|
||||
linux-headers \
|
||||
cmake \
|
||||
git \
|
||||
wget \
|
||||
curl \
|
||||
cpio \
|
||||
xz \
|
||||
gzip \
|
||||
bc \
|
||||
perl \
|
||||
python3 \
|
||||
# Kernel build dependencies
|
||||
linux-lts-dev \
|
||||
linux-lts \
|
||||
elfutils-dev \
|
||||
openssl-dev \
|
||||
flex \
|
||||
bison \
|
||||
# Archive tools
|
||||
tar \
|
||||
bzip2 \
|
||||
unzip \
|
||||
# Text processing
|
||||
sed \
|
||||
grep \
|
||||
findutils \
|
||||
# JSON processing for GitHub API
|
||||
jq
|
||||
|
||||
# Create directories
|
||||
RUN mkdir -p /build/initramfs /build/kernel /build/output /build/github /build/configs/zinit /mnt/zinit
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /build
|
||||
|
||||
# Copy build scripts and configs
|
||||
COPY scripts/ /build/scripts/
|
||||
COPY configs/ /build/configs/
|
||||
|
||||
# Make scripts executable
|
||||
RUN chmod +x /build/scripts/*.sh
|
||||
|
||||
# Create build configuration
|
||||
RUN echo "BUILDMODE=${BUILDMODE}" > /build/build.conf && \
|
||||
echo "TARGETARCH=${TARGETARCH}" >> /build/build.conf && \
|
||||
echo "MINIMAL_MODE=${MINIMAL_MODE}" >> /build/build.conf && \
|
||||
echo "INITRAMFS_ROOT=/build/initramfs" >> /build/build.conf && \
|
||||
echo "KERNEL_DIR=/build/kernel" >> /build/build.conf && \
|
||||
echo "OUTPUT_DIR=/build/output" >> /build/build.conf && \
|
||||
echo "CONFIG_DIR=/build/configs" >> /build/build.conf
|
||||
|
||||
# Default command
|
||||
CMD ["/build/scripts/build-initramfs.sh"]
|
||||
Reference in New Issue
Block a user