From aedad6a920d4ed11abaa0693f89c769c9e9f9477 Mon Sep 17 00:00:00 2001 From: Andrei Radulescu Date: Mon, 22 Jul 2024 13:01:04 +0300 Subject: [PATCH] agnos-meta-builder --- Dockerfile.kernel => Dockerfile.builder | 8 +++----- Dockerfile.sparsify | 20 -------------------- build_kernel.sh | 13 +++++++------ build_system.sh | 9 ++++----- 4 files changed, 14 insertions(+), 36 deletions(-) rename Dockerfile.kernel => Dockerfile.builder (77%) delete mode 100644 Dockerfile.sparsify diff --git a/Dockerfile.kernel b/Dockerfile.builder similarity index 77% rename from Dockerfile.kernel rename to Dockerfile.builder index bb70a815..6c690f52 100644 --- a/Dockerfile.kernel +++ b/Dockerfile.builder @@ -4,10 +4,8 @@ ARG UNAME ARG UID ARG GID -# Set non-interactive installation ENV DEBIAN_FRONTEND=noninteractive -# Update and install necessary packages RUN apt-get update && \ apt-get install -y --no-install-recommends \ python2 \ @@ -15,8 +13,9 @@ RUN apt-get update && \ libssl-dev \ bc \ python-is-python2 \ - openssl && \ - rm -rf /var/lib/apt/lists/* + openssl \ + android-sdk-libsparse-utils \ + && rm -rf /var/lib/apt/lists/* RUN if [ ${UID:-0} -ne 0 ] && [ ${GID:-0} -ne 0 ]; then \ userdel -r `getent passwd ${UID} | cut -d : -f 1` > /dev/null 2>&1; \ @@ -25,5 +24,4 @@ RUN if [ ${UID:-0} -ne 0 ] && [ ${GID:-0} -ne 0 ]; then \ useradd -u $UID -g $GID ${UNAME} \ ;fi -# Set entrypoint to keep container running ENTRYPOINT ["tail", "-f", "/dev/null"] diff --git a/Dockerfile.sparsify b/Dockerfile.sparsify deleted file mode 100644 index c3d4f30b..00000000 --- a/Dockerfile.sparsify +++ /dev/null @@ -1,20 +0,0 @@ -FROM ubuntu:24.04 - -ARG UNAME -ARG UID -ARG GID - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && \ - apt-get install -y android-sdk-libsparse-utils && \ - rm -rf /var/lib/apt/lists/* - -RUN if [ ${UID:-0} -ne 0 ] && [ ${GID:-0} -ne 0 ]; then \ - userdel -r `getent passwd ${UID} | cut -d : -f 1` > /dev/null 2>&1; \ - groupdel -f `getent group ${GID} | cut -d : -f 1` > /dev/null 2>&1; \ - groupadd -g ${GID} -o ${UNAME} && \ - useradd -u $UID -g $GID ${UNAME}; \ - fi - -ENTRYPOINT ["tail", "-f", "/dev/null"] diff --git a/build_kernel.sh b/build_kernel.sh index 187a8566..a48b7772 100755 --- a/build_kernel.sh +++ b/build_kernel.sh @@ -21,12 +21,13 @@ if [[ "$(uname)" == 'Darwin' ]]; then fi # Setup kernel build container -docker build -f Dockerfile.kernel -t agnos-kernel $DIR \ - --build-arg UNAME=$(id -nu) \ - --build-arg UID=$(id -u) \ - --build-arg GID=$(id -g) -echo "Starting agnos-kernel container" -CONTAINER_ID=$(docker run -d -v $DIR:$DIR -w $DIR agnos-kernel) +echo "Building agnos-meta-builder docker image" +docker build -f Dockerfile.builder -t agnos-meta-builder $DIR \ + --build-arg UNAME=$(id -nu) \ + --build-arg UID=$(id -u) \ + --build-arg GID=$(id -g) +echo "Starting agnos-meta-builder container" +CONTAINER_ID=$(docker run -d -v $DIR:$DIR -w $DIR agnos-meta-builder) # Cleanup container on exit trap "echo \"Cleaning up container:\"; \ diff --git a/build_system.sh b/build_system.sh index 0cde0dd4..5588614c 100755 --- a/build_system.sh +++ b/build_system.sh @@ -49,14 +49,13 @@ echo "Creating agnos-builder container" CONTAINER_ID=$(docker container create --entrypoint /bin/bash agnos-builder:latest) # Setup mount container for macOS and CI support (namespace.so) -echo "Building agnos-mount docker image" -docker build -f Dockerfile.sparsify -t agnos-mount $DIR \ +echo "Building agnos-meta-builder docker image" +docker build -f Dockerfile.builder -t agnos-meta-builder $DIR \ --build-arg UNAME=$(id -nu) \ --build-arg UID=$(id -u) \ --build-arg GID=$(id -g) - -echo "Starting agnos-mount container" -MOUNT_CONTAINER_ID=$(docker run -d --privileged -v $DIR:$DIR agnos-mount) +echo "Starting agnos-meta-builder container" +MOUNT_CONTAINER_ID=$(docker run -d --privileged -v $DIR:$DIR agnos-meta-builder) # Cleanup containers on possible exit trap "echo \"Cleaning up containers:\"; \