-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
50 lines (45 loc) · 1.28 KB
/
Dockerfile
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
FROM --platform=$TARGETPLATFORM debian:bookworm-20240812-slim
ENV LANG=C.UTF-8 USER=root HOME=/root
# Tools for dockerfiles and image management
COPY rootfs /
# Base tools that are used by all images
RUN apt_install \
runit \
gettext-base \
ca-certificates \
curl \
jo \
jq \
less \
make \
time \
git \
openssh-client \
file \
# Copy single binaries from packages and remove packages
&& cp /usr/bin/chpst \
/usr/bin/envsubst \
/usr/local/bin \
&& dpkg -P runit gettext-base \
&& apt-get -qqy autoremove \
&& dpkg -l|awk '/^rc/ {print $2}'|xargs -r dpkg -P \
&& (cd /usr/local/bin && ln -s chpst setuidgid && ln -s chpst softlimit && ln -s chpst setlock) \
\
# Create basic folders
&& mkdir -p /feedback /submission /exercise \
&& chmod 0770 /feedback \
\
# Change HOME for nobody from /nonexistent to /tmp
&& usermod -d /tmp nobody \
# Create two more nobody users
&& groupadd doer -g 65501 \
&& useradd doer -u 65501 -g 65501 -c "a nobody user" -s /usr/sbin/nologin -m -k - \
&& groupadd tester -g 65502 \
&& useradd tester -u 65502 -g 65502 -c "a nobody user" -s /usr/sbin/nologin -m -k - \
&& :
# Base grading tools
COPY bin /usr/local/bin
# Base environment
WORKDIR /submission
ENTRYPOINT ["/gw"]
CMD ["/exercise/run.sh"]