diff --git a/Dockerfile b/Dockerfile index 407d1c6..0b81825 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,27 @@ # syntax=docker/dockerfile:1 -FROM focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest +FROM focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest-slim + +# use sjtug mirror for faster download +RUN rm -rf /etc/apt/sources.list.d/* && cat < /etc/apt/sources.list +deb http://mirror.sjtu.edu.cn/debian bookworm main +deb http://mirror.sjtu.edu.cn/debian-security bookworm-security main +deb http://mirror.sjtu.edu.cn/debian bookworm-updates main +EOF RUN apt-get update && \ - apt-get install -y sudo && \ + apt-get install -y sudo python3-minimal pipx git && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ + userdel -r node && \ useradd -u 1000 -ms /bin/bash tt && \ useradd -u 1001 -ms /bin/bash student && \ echo "student ALL=(tt) NOPASSWD:/usr/local/bin/joj3" > /etc/sudoers.d/joj # install joint-teapot # TODO: change it to FOCS gitea mirror for deployment -RUN pip install --no-cache-dir git+https://mirror.ghproxy.com/https://github.com/BoYanZh/Joint-Teapot +RUN pipx install git+https://mirror.ghproxy.com/https://github.com/BoYanZh/Joint-Teapot && \ + ln -s /root/.local/bin/joint-teapot /usr/local/bin/joint-teapot # install joj3 binary COPY bin/joj3 /usr/local/bin/ diff --git a/Makefile b/Makefile index 28862c9..94e0769 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ all: build build: - docker build -t focs.ji.sjtu.edu.cn:5000/gitea/runner-images:focs-ubuntu-latest . + docker build -t focs.ji.sjtu.edu.cn:5000/gitea/runner-images:focs-ubuntu-latest-slim . push: - docker push focs.ji.sjtu.edu.cn:5000/gitea/runner-images:focs-ubuntu-latest + docker push focs.ji.sjtu.edu.cn:5000/gitea/runner-images:focs-ubuntu-latest-slim