Files

44 lines
1.2 KiB
Docker
Raw Permalink Normal View History

2025-10-11 13:19:20 +07:00
FROM python:3.12-slim
ARG PASSWORD=root
ENV DEBIAN_FRONTEND=noninteractive
2025-10-26 11:33:41 +07:00
ENV HOME=/home/ctfuser
WORKDIR /home/ctfuser/chall
2025-10-11 13:19:20 +07:00
# Allow apt on hosts whose clock is past GPG key expiry (2026+)
COPY apt-insecure.conf /etc/apt/apt.conf.d/99gemastik-insecure
RUN apt-get -o Acquire::AllowInsecureRepositories=true update && apt-get -y --allow-unauthenticated install --no-install-recommends \
2025-10-11 13:19:20 +07:00
openssh-server \
build-essential \
libffi-dev \
libssl-dev \
python3-dev \
2025-10-25 14:18:49 +07:00
socat \
vim \
curl \
wget \
netcat-openbsd \
git \
2025-10-11 13:19:20 +07:00
bash \
&& rm -rf /var/lib/apt/lists/*
2025-10-26 11:33:41 +07:00
RUN useradd -m -d /home/ctfuser -s /bin/bash ctfuser && \
echo "ctfuser:${PASSWORD}" | chpasswd
2025-10-11 13:19:20 +07:00
RUN mkdir -p /var/run/sshd
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
2025-10-26 11:33:41 +07:00
COPY ./src /home/ctfuser/chall/src
2025-10-11 13:19:20 +07:00
COPY ./start.sh /start.sh
2025-10-26 11:33:41 +07:00
RUN chmod +x /start.sh /home/ctfuser/chall/src/run.sh
2025-10-11 13:19:20 +07:00
2025-10-26 11:33:41 +07:00
RUN chown -R root:root /home/ctfuser/chall && \
chmod -R 555 /home/ctfuser/chall && \
chown ctfuser:ctfuser /home/ctfuser/chall/src/chall.py && \
chmod 755 /home/ctfuser/chall/src/chall.py
2025-10-11 13:19:20 +07:00
EXPOSE 8000 22
CMD ["/start.sh"]