Skip to content

Commit

Permalink
agnos-meta-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
andiradulescu committed Jul 22, 2024
1 parent f5a02b1 commit aedad6a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 36 deletions.
8 changes: 3 additions & 5 deletions Dockerfile.kernel → Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ 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 \
build-essential \
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; \
Expand All @@ -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"]
20 changes: 0 additions & 20 deletions Dockerfile.sparsify

This file was deleted.

13 changes: 7 additions & 6 deletions build_kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:\"; \
Expand Down
9 changes: 4 additions & 5 deletions build_system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:\"; \
Expand Down

0 comments on commit aedad6a

Please sign in to comment.