Skip to content

Commit 2ea6113

Browse files
committed
Try to build the chroot outside first
We need priviliges for the debootstrap, passing this to buildx is far from easy and we only need a simple setup
1 parent 86a14ae commit 2ea6113

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

docker-gitlabci/Dockerfile

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,4 @@ RUN wget $GITHUBDICTIONARY -O $CODESPELLDICTLOCATION
6464
RUN mkdir -p /run/php \
6565
&& rm /etc/php/*/fpm/pool.d/www.conf
6666

67-
RUN du -sh /* || true
68-
69-
# Cache the chroot
70-
RUN cd / && wget https://github.com/DOMjudge/domjudge/archive/refs/heads/main.zip
71-
RUN cd / && unzip main.zip
72-
RUN cd /domjudge-main && make configure
73-
RUN cd /domjudge-main && ./configure --with-domjudge-user=domjudge
74-
RUN cd /domjudge-main/misc-tools && make dj_make_chroot
75-
RUN cd /domjudge-main/misc-tools && ./dj_make_chroot
76-
RUN rm -rf /domjudge-main
77-
78-
RUN du -sh /* || true
67+
COPY ["chroot", "/chroot"]

docker-gitlabci/build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ else
2020
REGISTRY=$2
2121
fi
2222

23+
echo "[..] Building an example chroot..."
24+
wget https://github.com/DOMjudge/domjudge/archive/refs/heads/main.zip
25+
unzip main.zip
26+
cd domjudge-main
27+
make configure
28+
./configure --with-domjudge-user=domjudge --with-judgehost_chrootdir=`pwd`/chroot
29+
cd misc-tools
30+
make dj_make_chroot
31+
sudo ./dj_make_chroot
32+
2333
echo "[..] Building Docker image for Gitlab CI..."
2434
cp -r ../docker-contributor/php-config ./
2535
docker build -t "${REGISTRY}:${VERSION}" .

0 commit comments

Comments
 (0)