# docker build -t gearboy . && docker run --rm -it -p1024:1024 gearboy FROM ubuntu:20.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install --no-install-recommends -y xinetd libncurses5-dev libncurses5 python3 python3-pip gdbserver build-essential git libsdl2-dev libglew-dev && \ apt-get clean RUN pip3 install --no-cache-dir cryptography==3.3 pwntools RUN useradd -d /home/ctf/ -m -p ctf -s /bin/bash ctf && echo "ctf:ctf" | chpasswd WORKDIR /home/ctf RUN git clone https://github.com/drhelius/Gearboy.git gearboy && cd gearboy && git checkout 2cb66cdcb05f77147b9a5941e8ab92bceea828ae WORKDIR /home/ctf/gearboy/ COPY headless.patch /home/ctf/gearboy/ RUN git apply --ignore-space-change --ignore-whitespace headless.patch WORKDIR /home/ctf/gearboy/platforms/linux RUN make COPY flag / COPY wrapper.py /home/ctf/wrapper.py COPY python_svc /etc/xinetd.d/ env TERM=linux TERMINFO=/etc/terminfo EXPOSE 1024 CMD ["xinetd", "-dontfork"]