-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
191 lines (159 loc) · 6.04 KB
/
Dockerfile
File metadata and controls
191 lines (159 loc) · 6.04 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
FROM rust:slim-bookworm as builder
WORKDIR /work
RUN apt-get update && apt-get install -y libssl-dev pkg-config
COPY .env .
COPY Cargo.lock .
COPY Cargo.toml .
COPY src ./src
RUN cargo fetch
RUN cargo build --release
FROM debian:bookworm
ENV TZ Asia/Tokyo
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]
# install compilers
RUN \
apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
apt-transport-https \
dirmngr \
curl \
wget \
time \
iproute2 \
build-essential \
sudo \
unzip \
git \
libbz2-dev libdb-dev libreadline-dev libffi-dev \
libgdbm-dev liblzma-dev libncursesw5-dev libsqlite3-dev \
libssl-dev zlib1g-dev uuid-dev pkg-config openssl
RUN mkdir -p /judge
# Raku install
RUN apt-get install -y rakudo --no-install-recommends
# C#(.NET) install
RUN wget -O dotnet-sdk.tar.gz https://download.visualstudio.microsoft.com/download/pr/dd6ee0c0-6287-4fca-85d0-1023fc52444b/874148c23613c594fc8f711fc0330298/dotnet-sdk-8.0.302-linux-x64.tar.gz && \
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk.tar.gz -C $HOME/dotnet
ENV PATH $PATH:/root/dotnet
ENV DOTNET_ROOT /root/dotnet
ENV DOTNET_EnableWriteXorExecute 0
ENV COMPlus_EnableDiagnostics 0
RUN cd /judge && \
curl -L https://raw.githubusercontent.com/mofecoder/language-update/24.07/CSharp/Main.csproj -o Main.csproj && \
echo 'Console.WriteLine();' > Main.cs && \
dotnet publish -o /tmp -c Release -v q --nologo 1>&2 && \
rm Main.cs
# C/C++ (gcc) install
RUN apt-get install build-essential gcc-12 g++-12 -y --no-install-recommends
RUN mkdir /opt/ac-library && \
cd /tmp && \
wget https://github.com/atcoder/ac-library/releases/download/v1.5.1/ac-library.zip && \
unzip /tmp/ac-library.zip -d /opt/ac-library
# C/C++ (clang) install
RUN apt-get install clang-16 -y --no-install-recommends
# Fortran install
RUN apt-get install gfortran -y --no-install-recommends
# Python3 install
RUN apt install libopenblas-dev liblapack-dev -y --no-install-recommends &&\
wget https://www.python.org/ftp/python/3.12.4/Python-3.12.4.tgz && \
tar xzf Python-3.12.4.tgz && \
cd Python-3.12.4 && \
./configure --enable-optimizations && \
make && \
make install
RUN python3.12 -m pip install --upgrade pip && \
python3.12 -m pip install setuptools && \
python3.12 -m pip install git+https://github.com/not522/ac-library-python \
networkx==3.1 \
sympy==1.12 \
sortedcontainers==2.4.0 \
bitarray==2.8.0
# PyPy3 install
RUN cd /opt && \
wget https://downloads.python.org/pypy/pypy3.10-v7.3.16-linux64.tar.bz2 && \
tar xf pypy3.10-v7.3.16-linux64.tar.bz2 && \
ln -s /opt/pypy3.10-v7.3.16-linux64/bin/pypy3 /bin/pypy3
RUN pypy3 -m ensurepip && \
pypy3 -m pip install --upgrade pip && \
pypy3 -m pip install setuptools && \
pypy3 -m pip install --break-system-packages \
git+https://github.com/not522/ac-library-python \
setuptools \
numpy==1.25.0 \
networkx==3.1 \
sympy==1.12 \
sortedcontainers==2.4.0 \
bitarray==2.8.0
# Ruby install
RUN apt-get install make libffi-dev openssl libssl-dev zlib1g-dev libyaml-dev -y --no-install-recommends && \
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv && \
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile && \
echo 'eval "$(rbenv init -)"' >> ~/.profile && \
bash -c exec $SHELL -l && \
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build && \
export PATH="$HOME/.rbenv/bin:$PATH" && rbenv install 3.3.2 && rbenv global 3.3.2
ENV PATH $PATH:/root/.rbenv/bin:/root/.rbenv/shims
RUN gem install rbtree ac-library-rb sorted_set
# Rust install
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH $PATH:/root/.cargo/bin
RUN \
cd judge && \
cargo init --bin . && \
curl -OL https://raw.githubusercontent.com/mofecoder/language-update/24.07/Rust/Cargo.toml && \
cargo build --release
# Java install
RUN apt-get install openjdk-17-jdk -y
# go install
RUN cd /tmp && \
wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.22.5.linux-amd64.tar.gz
ENV PATH $PATH:/usr/local/go/bin
ENV USER=$USER
# Nim install
RUN curl https://nim-lang.org/choosenim/init.sh -sSf | sh -s -- -y 2.0.8
ENV PATH $PATH:/root/.nimble/bin
RUN nimble install https://github.com/zer0-star/Nim-ACL
# Kotlin install
RUN apt-get install zip unzip -y --no-install-recommends && \
curl -s https://get.sdkman.io | bash && \
bash && \
echo 'source "/root/.sdkman/bin/sdkman-init.sh"' >> ~/.profile && \
source ~/.profile && \
sdk install kotlin
ENV PATH $PATH:/root/.sdkman/candidates/kotlin/current/bin
# Crystal install
RUN apt-get install gnupg ca-certificates apt-transport-https -y --no-install-recommends && \
curl -fsSL https://crystal-lang.org/install.sh | bash
# Perl install
RUN wget https://www.cpan.org/src/5.0/perl-5.38.2.tar.gz && \
tar -xzf perl-5.38.2.tar.gz && \
cd perl-5.38.2 && \
./Configure -Dprefix=$HOME/perl -Dscriptdir=$HOME/perl/bin -des -Dman1dir=none -Dman3dir=none -DDEBUGGING=-g && \
make --jobs=8 install
# dc install
RUN apt-get install dc -y --no-install-recommends
# install testlib
RUN mkdir /opt/testlib && \
wget -P /opt/testlib https://raw.githubusercontent.com/MikeMirzayanov/testlib/master/testlib.h
# install isolate
RUN \
apt-get install libsystemd-dev libcap-dev --no-install-recommends && \
git clone https://github.com/ioi/isolate.git /isolate && \
git checkout -b master refs/tags/1.10.1
COPY ./default.cf /isolate/default.cf
RUN cd /isolate && make install
RUN apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /tmp && mkdir /tmp
ENV DOWNLOAD_ROOT=/download
ENV DOTNET_ROOT=$HOME/dotnet
ENV DOWNLOAD_ROOT=/download
RUN mkdir /download
RUN mkdir /box
RUN chmod -R 777 /judge
RUN chmod 777 /root
WORKDIR /
COPY default.cf .
COPY Rocket.toml .
COPY --from=builder /work/target/release/cafecoder-docker-rs app
RUN source $HOME/.profile && dotnet -v ; exit 0
ENTRYPOINT ["./app"]