Fixed incorrect naming
This commit is contained in:
69
docker/ask.Dockerfile
Normal file
69
docker/ask.Dockerfile
Normal file
@@ -0,0 +1,69 @@
|
||||
ARG BUILD_BASE_TAG=dev
|
||||
ARG DOCKER_IMAGE_ROOT=monok8s
|
||||
|
||||
FROM --platform=$BUILDPLATFORM ${DOCKER_IMAGE_ROOT}/build-base:${BUILD_BASE_TAG} AS build
|
||||
|
||||
# Install glibc cross-compiler for kernel and standard build dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
crossbuild-essential-arm64 \
|
||||
patch bzip2 pkg-config \
|
||||
libxml2-dev libtclap-dev
|
||||
|
||||
# Provision the musl cross-compiler from musl.cc
|
||||
RUN curl -O https://musl.cc/aarch64-linux-musl-cross.tgz && \
|
||||
tar xzf aarch64-linux-musl-cross.tgz -C /opt && \
|
||||
rm aarch64-linux-musl-cross.tgz
|
||||
|
||||
# Expose the musl compiler to the PATH
|
||||
ENV PATH="/opt/aarch64-linux-musl-cross/bin:${PATH}"
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
ARG NXP_TAR
|
||||
ARG MONO_ASK_TAR
|
||||
ARG LIBNFNETLINK_TAR
|
||||
ARG LIBNFCT_TAR
|
||||
|
||||
ARG NXP_VERSION
|
||||
ARG MONO_ASK_VERSION
|
||||
ARG LIBNFNETLINK_VERSION
|
||||
ARG LIBNFCT_VERSION
|
||||
|
||||
# Linux kernel
|
||||
COPY "${NXP_TAR}" ./kernel.tar.gz
|
||||
|
||||
# Copy the ASK and Netfilter tarballs
|
||||
COPY "${MONO_ASK_TAR}" .
|
||||
COPY "${LIBNFNETLINK_TAR}" ./libnfnetlink-${LIBNFNETLINK_VERSION}.tar.bz2
|
||||
COPY "${LIBNFCT_TAR}" ./libnetfilter_conntrack-${LIBNFCT_VERSION}.tar.xz
|
||||
|
||||
# Extract ASK and place Netfilter dependencies where the Makefile expects them
|
||||
RUN mkdir -p ASK/sources/tarballs && \
|
||||
tar zxf "${MONO_ASK_VERSION}.tar.gz" -C "ASK" --strip-components=1 && \
|
||||
mv libnfnetlink-${LIBNFNETLINK_VERSION}.tar.bz2 ASK/sources/tarballs/ && \
|
||||
mv libnetfilter_conntrack-${LIBNFCT_VERSION}.tar.xz ASK/sources/tarballs/
|
||||
|
||||
RUN mkdir linux && tar zxf "kernel.tar.gz" -C "linux" --strip-components=1
|
||||
|
||||
WORKDIR /src/ASK
|
||||
|
||||
# 1. Build Kernel and Modules with the glibc cross-compiler
|
||||
RUN make kernel KDIR=/src/linux CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64
|
||||
RUN make modules KDIR=/src/linux CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64
|
||||
|
||||
# 2. Build Userspace with the musl cross-compiler
|
||||
# Overriding HOST forces the Netfilter./configure steps to use musl
|
||||
# Setting CC and CXX with -static ensures portability in the Alpine rootfs
|
||||
RUN make sources KDIR=/src/linux CROSS_COMPILE=aarch64-linux-musl- ARCH=arm64 HOST=aarch64-linux-musl
|
||||
RUN make userspace KDIR=/src/linux CROSS_COMPILE=aarch64-linux-musl- ARCH=arm64 \
|
||||
HOST=aarch64-linux-musl \
|
||||
CC="aarch64-linux-musl-gcc -static" \
|
||||
CXX="aarch64-linux-musl-g++ -static"
|
||||
|
||||
# Stage the artifacts
|
||||
RUN make dist
|
||||
|
||||
# Export stage to isolate compiled artifacts for monok8s build-rootfs.sh
|
||||
FROM scratch AS export
|
||||
COPY --from=build /src/ASK/dist/ /ASK/
|
||||
COPY --from=build /src/linux/arch/arm64/boot/Image /kernel/Image
|
||||
Reference in New Issue
Block a user