forked from emilytouchingcomputers/CTFium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (25 loc) · 893 Bytes
/
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
FROM ubuntu:latest
MAINTAINER [email protected]
# Prepare environment and install required packages
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y git libtinfo-dev python3 xz-utils git curl pkg-config xinetd python2.7
RUN mkdir -p /challenge/conf/ /workdir/
RUN curl -sSL https://get.haskellstack.org/ | sh
# Add ctf user
RUN mkdir /home/ctf/ \
&& groupadd -g 1001 ctf \
&& useradd -g ctf -u 1001 -d /home/ctf/ ctf \
&& chown ctf:ctf /home/ctf/
# Add flag
ADD ./flag /flag
RUN chown root:root /flag && chmod 600 /flag
ADD ./flag_reader /flag_reader
RUN chown root:root /flag_reader && chmod 4755 /flag_reader
# Install challenge
ADD ./deploy/server.py /challenge/server.py
ADD ./deploy/run.sh /challenge/run.sh
COPY ./plugin /challenge/plugin
RUN cd /challenge/plugin && stack build
# Setup network
ADD ./problem /etc/xinetd.d/
CMD ["/usr/sbin/xinetd", "-dontfork"]