2022-10-04 12:57:49 +00:00
FROM ubuntu:22.04
2022-03-16 09:00:39 +00:00
2022-11-06 02:26:21 +00:00
SHELL [ "/bin/bash" , "-c" ]
2022-03-16 09:00:39 +00:00
2022-09-19 13:53:12 +00:00
ENV DEBIAN_FRONTEND = noninteractive
2023-02-13 10:44:48 +00:00
RUN apt-get update && \
2023-11-18 13:40:47 +00:00
apt-get install -y --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
curl https://git.m.ac/api/packages/baoshuo/debian/repository.key -o /etc/apt/trusted.gpg.d/gitmac-baoshuo.asc && \
echo "deb https://git.m.ac/api/packages/baoshuo/debian all main" | tee -a /etc/apt/sources.list.d/gitmac-baoshuo.list && \
2023-02-13 10:44:48 +00:00
apt-get update && \
2023-11-18 13:40:47 +00:00
for pkg in vim ntp zip unzip wget build-essential fp-compiler s2oj-gcc python2.7 python3.10 python3-requests libseccomp-dev openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk tzdata; do \
2023-02-13 10:44:48 +00:00
cnt = 10 && \
while ! apt-get install -y " $pkg " ; do \
if [ $cnt -le 0 ] ; then \
echo " Failed to install $pkg " && \
exit 1; \
fi ; \
cnt = $(( cnt - 1 )) ; \
done ; \
done
2022-09-19 13:53:12 +00:00
2022-03-16 09:00:39 +00:00
ADD . /opt/uoj_judger
WORKDIR /opt/uoj_judger
# Install environment and set startup script
2022-11-06 02:26:21 +00:00
RUN sh install.sh -p && echo -e " \
2022-03-16 09:00:39 +00:00
#!/bin/sh\n\
if [ ! -f \" /opt/uoj_judger/.conf.json\" ] ; then \n \
cd /opt/uoj_judger && sh install.sh -i\n \
fi \n \
service ntp start\n \
su judger -c \" /opt/uoj_judger/judge_client start\" \n \
exec bash\n " >/opt/up && chmod +x /opt/up
ENV LANG = C.UTF-8 TZ = Asia/Shanghai
EXPOSE 2333
CMD /opt/up