diff --git a/Dockerfile b/Dockerfile index 328cbd7..060e62c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,19 @@ -FROM registry.hub.docker.com/library/ubuntu:16.04 +FROM ubuntu:18.04 COPY build/java_policy /etc -RUN buildDeps='software-properties-common git libtool cmake python-dev python3-pip python-pip libseccomp-dev' && \ - apt-get update && apt-get install -y python python3.5 python-pkg-resources python3-pkg-resources $buildDeps && \ - add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update && apt-get install -y gcc-9 g++-9 && \ - rm /usr/bin/gcc /usr/bin/g++ && ln -s /usr/bin/gcc-9 /usr/bin/gcc && ln -s /usr/bin/g++-9 /usr/bin/g++ && \ - add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk && \ - pip3 install --no-cache-dir psutil gunicorn flask requests && \ +RUN apt-get update && apt-get install -y wget && wget https://github.com/Harry-zklcdc/JudgeServer/raw/18.04/sources.list && mv sources18.04.list /etc/apt/sources.list && \ + buildDeps='software-properties-common git libtool cmake python-dev python3-pip python-pip libseccomp-dev' && \ + apt-get update && apt-get install -y python python3.6 python-pkg-resources python3-pkg-resources gcc-8 g++-8 openjdk-8-jdk $buildDeps && \ + rm /usr/bin/gcc /usr/bin/g++ && ln -s /usr/bin/gcc-8 /usr/bin/gcc && ln -s /usr/bin/g++-8 /usr/bin/g++ && \ + pip3 install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/ && cp /usr/bin/pip /usr/bin/pip3 && \ + pip install --no-cache-dir psutil gunicorn flask requests -i https://mirrors.aliyun.com/pypi/simple/ && \ + pip uninstall idna -y && pip install --no-cache-dir idna -i https://mirrors.aliyun.com/pypi/simple/ && \ cd /tmp && git clone -b newnew --depth 1 https://github.com/QingdaoU/Judger && cd Judger && \ mkdir build && cd build && cmake .. && make && make install && cd ../bindings/Python && python3 setup.py install && \ - apt-get purge -y --auto-remove $buildDeps && \ + apt-get purge -y --auto-remove wget $buildDeps && \ apt-get clean && rm -rf /var/lib/apt/lists/* && \ - ln -s /usr/bin/gcc-9 /usr/bin/gcc && ln -s /usr/bin/g++-9 /usr/bin/g++ && \ + ln -s /usr/bin/gcc-8 /usr/bin/gcc && ln -s /usr/bin/g++-8 /usr/bin/g++ && \ mkdir -p /code && \ useradd -u 12001 compiler && useradd -u 12002 code && useradd -u 12003 spj && usermod -a -G code spj diff --git a/Dockerfile-18.04 b/Dockerfile-18.04 deleted file mode 100644 index d609a04..0000000 --- a/Dockerfile-18.04 +++ /dev/null @@ -1,25 +0,0 @@ -FROM ubuntu:18.04 - -COPY build/java_policy /etc - -RUN apt-get update && apt-get install -y wget && wget https://raw.githubusercontent.com/Harry-zklcdc/JudgeServer/master/sources18.04.list && mv sources18.04.list /etc/apt/sources.list && \ - buildDeps='software-properties-common git libtool cmake python-dev python3-pip python-pip libseccomp-dev' && \ - apt-get update && apt-get install -y python python3.6 python-pkg-resources python3-pkg-resources gcc-8 g++-8 openjdk-8-jdk $buildDeps && \ - rm /usr/bin/gcc /usr/bin/g++ && ln -s /usr/bin/gcc-8 /usr/bin/gcc && ln -s /usr/bin/g++-8 /usr/bin/g++ && \ - pip3 install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/ && cp /usr/bin/pip /usr/bin/pip3 && \ - pip install --no-cache-dir psutil gunicorn flask requests -i https://mirrors.aliyun.com/pypi/simple/ && \ - pip uninstall idna -y && pip install --no-cache-dir idna -i https://mirrors.aliyun.com/pypi/simple/ && \ - cd /tmp && git clone -b newnew --depth 1 https://github.com/QingdaoU/Judger && cd Judger && \ - mkdir build && cd build && cmake .. && make && make install && cd ../bindings/Python && python3 setup.py install && \ - apt-get purge -y --auto-remove wget $buildDeps && \ - apt-get clean && rm -rf /var/lib/apt/lists/* && \ - ln -s /usr/bin/gcc-8 /usr/bin/gcc && ln -s /usr/bin/g++-8 /usr/bin/g++ && \ - mkdir -p /code && \ - useradd -u 12001 compiler && useradd -u 12002 code && useradd -u 12003 spj && usermod -a -G code spj - -HEALTHCHECK --interval=5s --retries=3 CMD python3 /code/service.py -ADD server /code -WORKDIR /code -RUN gcc -shared -fPIC -o unbuffer.so unbuffer.c -EXPOSE 8080 -ENTRYPOINT /code/entrypoint.sh diff --git a/Dockerfile-cn b/Dockerfile-cn deleted file mode 100644 index fa0c0ea..0000000 --- a/Dockerfile-cn +++ /dev/null @@ -1,25 +0,0 @@ -FROM ubuntu:16.04 - -COPY build/java_policy /etc - -RUN apt-get update && apt-get install -y wget && wget https://raw.githubusercontent.com/Harry-zklcdc/JudgeServer/master/sources.list && mv sources.list /etc/apt/sources.list && \ - buildDeps='software-properties-common git libtool cmake python-dev python3-pip python-pip libseccomp-dev' && \ - apt-get update && apt-get install -y python python3.5 python-pkg-resources python3-pkg-resources $buildDeps && \ - add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update && apt-get install -y gcc-9 g++-9 && \ - rm /usr/bin/gcc /usr/bin/g++ && ln -s /usr/bin/gcc-9 /usr/bin/gcc && ln -s /usr/bin/g++-9 /usr/bin/g++ && \ - add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk && \ - pip3 install --no-cache-dir psutil gunicorn flask requests -i https://mirrors.aliyun.com/pypi/simple/ && \ - cd /tmp && git clone -b newnew --depth 1 https://github.com/QingdaoU/Judger && cd Judger && \ - mkdir build && cd build && cmake .. && make && make install && cd ../bindings/Python && python3 setup.py install && \ - apt-get purge -y --auto-remove wget $buildDeps && \ - apt-get clean && rm -rf /var/lib/apt/lists/* && \ - ln -s /usr/bin/gcc-9 /usr/bin/gcc && ln -s /usr/bin/g++-9 /usr/bin/g++ && \ - mkdir -p /code && \ - useradd -u 12001 compiler && useradd -u 12002 code && useradd -u 12003 spj && usermod -a -G code spj - -HEALTHCHECK --interval=5s --retries=3 CMD python3 /code/service.py -ADD server /code -WORKDIR /code -RUN gcc -shared -fPIC -o unbuffer.so unbuffer.c -EXPOSE 8080 -ENTRYPOINT /code/entrypoint.sh diff --git a/sources.list b/sources.list index bf1d297..b4235db 100644 --- a/sources.list +++ b/sources.list @@ -1,33 +1,76 @@ -deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties +#阿里云 Ubuntu 18.04源 +deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse +deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse +deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse -deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted +#网易源 +deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse +deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse +deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse +deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse +deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse +deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse +deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse +deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse +deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse +deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse -deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties +#官方中国源 +#deb cdrom:[Ubuntu 18.04.1 LTS _Bionic Beaver_ - Release amd64 (20180725)]/ bionic main restricted -deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to +# newer versions of the distribution. +deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted +# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted -deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties +## Major bug fix updates produced after the final release of the +## distribution. +deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted +# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted -deb http://mirrors.aliyun.com/ubuntu/ xenial universe +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team. Also, please note that software in universe WILL NOT receive any +## review or updates from the Ubuntu security team. +#deb http://cn.archive.ubuntu.com/ubuntu/ bionic universe +# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic universe +deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe +# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe -deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## multiverse WILL NOT receive any review or updates from the Ubuntu +## security team. +deb http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse +# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse +deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse +# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse -deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse +## N.B. software from this repository may not have been tested as +## extensively as that contained in the main release, although it includes +## newer versions of some applications which may provide useful features. +## Also, please note that software in backports WILL NOT receive any review +## or updates from the Ubuntu security team. +deb http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse +# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse -deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse +## Uncomment the following two lines to add software from Canonical's +## 'partner' repository. +## This software is not part of Ubuntu, but is offered by Canonical and the +## respective vendors as a service to Ubuntu users. +# deb http://archive.canonical.com/ubuntu bionic partner +# deb-src http://archive.canonical.com/ubuntu bionic partner -deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse - -deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties - -deb http://archive.canonical.com/ubuntu xenial partner - -deb-src http://archive.canonical.com/ubuntu xenial partner - -deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted - -deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties - -deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe - -deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse +deb http://security.ubuntu.com/ubuntu bionic-security main restricted +# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted +deb http://security.ubuntu.com/ubuntu bionic-security universe +# deb-src http://security.ubuntu.com/ubuntu bionic-security universe +deb http://security.ubuntu.com/ubuntu bionic-security multiverse +# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse diff --git a/sources18.04.list b/sources18.04.list deleted file mode 100644 index b4235db..0000000 --- a/sources18.04.list +++ /dev/null @@ -1,76 +0,0 @@ -#阿里云 Ubuntu 18.04源 -deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse -deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse -deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse -deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse -deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse -deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse -deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse -deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse -deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse -deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse - -#网易源 -deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse -deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse -deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse -deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse -deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse -deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse -deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse -deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse -deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse -deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse - -#官方中国源 -#deb cdrom:[Ubuntu 18.04.1 LTS _Bionic Beaver_ - Release amd64 (20180725)]/ bionic main restricted - -# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to -# newer versions of the distribution. -deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted -# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted - -## Major bug fix updates produced after the final release of the -## distribution. -deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted -# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team. Also, please note that software in universe WILL NOT receive any -## review or updates from the Ubuntu security team. -#deb http://cn.archive.ubuntu.com/ubuntu/ bionic universe -# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic universe -deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe -# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team, and may not be under a free licence. Please satisfy yourself as to -## your rights to use the software. Also, please note that software in -## multiverse WILL NOT receive any review or updates from the Ubuntu -## security team. -deb http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse -# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse -deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse -# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse - -## N.B. software from this repository may not have been tested as -## extensively as that contained in the main release, although it includes -## newer versions of some applications which may provide useful features. -## Also, please note that software in backports WILL NOT receive any review -## or updates from the Ubuntu security team. -deb http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse -# deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse - -## Uncomment the following two lines to add software from Canonical's -## 'partner' repository. -## This software is not part of Ubuntu, but is offered by Canonical and the -## respective vendors as a service to Ubuntu users. -# deb http://archive.canonical.com/ubuntu bionic partner -# deb-src http://archive.canonical.com/ubuntu bionic partner - -deb http://security.ubuntu.com/ubuntu bionic-security main restricted -# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted -deb http://security.ubuntu.com/ubuntu bionic-security universe -# deb-src http://security.ubuntu.com/ubuntu bionic-security universe -deb http://security.ubuntu.com/ubuntu bionic-security multiverse -# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse