-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
39 lines (33 loc) · 1.64 KB
/
Dockerfile.dev
File metadata and controls
39 lines (33 loc) · 1.64 KB
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
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN sed -E -i -e 's/(archive|ports).ubuntu.com/mirrors.aliyun.com/g' -e '/security.ubuntu.com/d' /etc/apt/sources.list
# build sandbox
ENV SANDBOX_BUILD_DEPS='cmake libseccomp-dev strace gcc g++'
RUN apt-get update && apt-get install -y $SANDBOX_BUILD_DEPS
COPY ./sandbox /sandbox
RUN cd /sandbox && mkdir build && cd build && cmake .. && make && make install && rm -rf /sandbox
RUN apt-get purge -y --auto-remove $SANDBOX_BUILD_DEPS
# build runtime
ENV RUNTIME_BUILD_DEPS='software-properties-common curl'
RUN apt-get update && apt-get install -y $RUNTIME_BUILD_DEPS && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \
add-apt-repository ppa:longsleep/golang-backports && \
# add-apt-repository ppa:openjdk-r/ppa && \
# curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get update && apt-get install -y golang-go && \
apt-get install -y python python3 python-pkg-resources python3-pkg-resources && \
# apt-get install -y openjdk-11-jdk nodejs gcc-9 g++-9 && \
# update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 40 && \
# update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 40 && \
mkdir -p /code && \
useradd -u 12001 compiler && useradd -u 12002 code && useradd -u 12003 spj && usermod -a -G code spj
RUN apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get purge -y --auto-remove $RUNTIME_BUILD_DEPS
# COPY build/java_policy /etc
ADD go.mod /code
ADD go.sum /code
RUN go install github.com/cosmtrek/air@latest
WORKDIR /code
ADD . /code
RUN go get .
RUN gcc -shared -fPIC -o unbuffer.so judger/config/unbuffer.c
EXPOSE 8080