ctf-tools/Dockerfile

37 lines
1.1 KiB
Text
Raw Permalink Normal View History

2025-03-08 23:44:35 -07:00
FROM ubuntu:noble
2015-11-03 18:27:49 -08:00
# wrapper script for apt-get
COPY .docker/apt-get-install /usr/local/bin/apt-get-install
RUN chmod +x /usr/local/bin/apt-get-install
2025-03-10 12:59:22 -07:00
RUN sed -i -e "s/Types: deb/Types: deb deb-src/g" /etc/apt/sources.list.d/ubuntu.sources
2022-03-01 11:01:58 +01:00
RUN apt-get-install build-essential libtool g++ gcc rubygems \
2025-03-09 00:12:22 -07:00
texinfo curl wget automake autoconf python3 python3-dev git \
2022-03-01 19:54:27 +01:00
unzip virtualenvwrapper sudo git subversion virtualenvwrapper ca-certificates
2025-03-09 15:01:04 -07:00
RUN userdel -f -r ubuntu; useradd -m ctf
RUN echo "ctf ALL=NOPASSWD: ALL" > /etc/sudoers.d/ctf
2025-03-09 01:39:32 -07:00
# a bit weird so that we don't invalidate this cache unless manage-tools changes
2015-11-03 18:27:49 -08:00
USER ctf
WORKDIR /home/ctf/tools
2025-03-09 01:39:32 -07:00
ADD --chown=ctf:ctf bin/manage-tools /home/ctf/tools/bin/manage-tools
RUN bin/manage-tools -s setup && rm bin/manage-tools
2025-03-09 01:39:32 -07:00
# now check out the repo and re-copy the script if modified
ADD --chown=ctf:ctf .git /home/ctf/tools/.git
RUN git checkout .
COPY bin/manage-tools /home/ctf/tools/bin/manage-tools
2015-11-03 18:27:49 -08:00
2025-03-09 01:25:20 -07:00
ARG PREINSTALL=""
RUN <<END
for TOOL in $PREINSTALL
do
/home/ctf/tools/bin/manage-tools -s -v install $TOOL
done
END
2025-03-09 01:50:41 -07:00
ENV PATH=/home/ctf/tools/bin:/bin:/sbin
2015-11-03 18:27:49 -08:00
WORKDIR /home/ctf