-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-CI
40 lines (38 loc) · 1.78 KB
/
Dockerfile-CI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM ubuntu:21.10
LABEL maintainer="xudian.cn@gmail.com"
ENV ENABLE_SENTRY=True
ENV TZ=UTC
ENV SDKMAN_DIR="/usr/local/sdkman"
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV OJ_ENV container
ENV OJ_SYNC_ENABLE False
ADD . /app
WORKDIR /app
RUN apt-get update
RUN apt-get -y install curl zip unzip python3 python3-dev python3-pip gcc g++ libseccomp-dev cmake git software-properties-common python-is-python3 \
golang-go python3-venv clang
RUN curl -s "https://get.sdkman.io" | bash
RUN chmod a+x "$SDKMAN_DIR/bin/sdkman-init.sh"
RUN bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh && sdk ls java && sdk install java 16.0.1.fx-librca && sdk ls kotlin && sdk install kotlin"
# "OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify
# were deprecated in JDK 13 and will likely be removed in a future release."
# so only add -noverify for older versions
# RUN sed -i "/noverify/d" /usr/local/sdkman/candidates/kotlin/current/bin/kotlinc
ENV JAVA_HONE=/usr/local/sdkman/candidates/java/current
ENV PATH=${PATH}:/usr/local/sdkman/candidates/kotlin/current/bin:/usr/local/sdkman/candidates/java/current/bin
RUN echo $PATH
RUN mkdir /config
RUN java -version 2> /config/java.info
RUN kotlin -version > /config/kotlin.info
RUN gcc -v 2> /config/gcc.info
RUN g++ -v 2> /config/g++.info
RUN clang -v 2> /config/clang.info
RUN clang++ -v 2> /config/clang++.info
RUN go version > /config/go.info
RUN python -V > /config/python.info
RUN cd /tmp && git clone --depth=1 https://github.com/wustacm/oj-core.git && cd oj-core \
&& mkdir build && cd build && cmake .. && make && make install && apt-get clean && rm -rf /var/lib/apt/lists/* \
&& mkdir /runner && useradd -u 12001 code
RUN pip3 install --no-cache-dir -r requirements.txt
# create virtual env
RUN python -m venv /opt/venv