-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdodona-csharp.dockerfile
More file actions
38 lines (31 loc) · 1.6 KB
/
Copy pathdodona-csharp.dockerfile
File metadata and controls
38 lines (31 loc) · 1.6 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
FROM mono:6.12.0.182
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Fix EOL buster repos + install jshon and time
RUN set -euxo pipefail; \
# Rewrite to archive mirrors (primary mirrors dropped buster)
sed -ri \
-e 's#http://deb.debian.org/debian#http://archive.debian.org/debian#g' \
-e 's#http://deb.debian.org/debian-security#http://archive.debian.org/debian-security#g' \
-e 's#http://security.debian.org/debian-security#http://archive.debian.org/debian-security#g' \
/etc/apt/sources.list; \
# If there are extra list files, rewrite those too (no-op if none)
find /etc/apt/sources.list.d -maxdepth 1 -type f -print0 2>/dev/null \
| xargs -0 -r sed -ri \
-e 's#http://deb.debian.org/debian#http://archive.debian.org/debian#g' \
-e 's#http://deb.debian.org/debian-security#http://archive.debian.org/debian-security#g' \
-e 's#http://security.debian.org/debian-security#http://archive.debian.org/debian-security#g'; \
# Archived suites often have expired metadata; disable date check
printf 'Acquire::Check-Valid-Until "false";\n' > /etc/apt/apt.conf.d/99no-check-valid-until; \
apt-get update --allow-releaseinfo-change; \
apt-get install -y --no-install-recommends jshon time; \
apt-get clean; rm -rf /var/lib/apt/lists/*
# Make sure the students can't find our secret path, which is mounted in
# /mnt with a secure random name.
RUN ["chmod", "711", "/mnt"]
# Add the user which will run the student's code and the judge.
RUN ["useradd", "-m", "runner"]
# As the runner user
USER runner
RUN ["mkdir", "/home/runner/workdir"]
WORKDIR /home/runner/workdir
COPY main.sh /main.sh