Files

39 lines
997 B
Docker
Raw Permalink Normal View History

2025-10-25 09:53:39 +07:00
# Dockerfile
FROM ubuntu:24.04
# Build-time args
ARG PASSWORD=root
ENV DEBIAN_FRONTEND=noninteractive
2025-10-25 14:18:49 +07:00
WORKDIR /home/ctfuser/chall
2025-10-25 09:53:39 +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-25 09:53:39 +07:00
make \
g++ \
socat \
build-essential \
openssh-server \
bash \
nano \
vim \
curl \
wget \
netcat-openbsd \
git \
2025-10-25 09:53:39 +07:00
&& rm -rf /var/lib/apt/lists/*
2025-10-25 14:18:49 +07:00
RUN useradd -m -d /home/ctfuser -s /bin/bash ctfuser && echo "ctfuser:${PASSWORD}" | chpasswd
2025-10-25 09:53:39 +07:00
RUN mkdir -p /var/run/sshd
2025-10-25 14:18:49 +07:00
COPY chall/ /home/ctfuser/chall
2025-10-25 09:53:39 +07:00
COPY ./entrypoint.sh /entrypoint.sh
2025-10-25 14:18:49 +07:00
RUN chmod +x /entrypoint.sh /home/ctfuser/chall/run.sh && \
2025-10-26 11:12:02 +07:00
chown -R ctfuser:ctfuser /home/ctfuser/chall && chmod -R 755 /home/ctfuser/chall
2025-10-25 09:53:39 +07:00
EXPOSE 9000 22
2025-10-26 11:12:02 +07:00
CMD ["/entrypoint.sh"]