pwndbg/Dockerfile.arch

55 lines
1.8 KiB
Docker

# This dockerfile was created for development & testing purposes, for Pacman-based distro.
#
# Build as: docker build -f Dockerfile.arch -t pwndbg .
#
# For testing use: docker run --rm -it --cap-add=SYS_PTRACE --security-opt seccomp=unconfined pwndbg bash
#
# For development, mount the directory so the host changes are reflected into container:
# docker run -it --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v `pwd`:/pwndbg pwndbg bash
#
ARG image=archlinux:latest
FROM $image
WORKDIR /pwndbg
ENV PIP_NO_CACHE_DIR=true
ENV LANG en_US.utf8
ENV TZ=America/New_York
ENV ZIGPATH=/opt/zig
ENV PWNDBG_VENV_PATH=/venv
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \
pacman -Syu --noconfirm && \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \
pacman -S --noconfirm vim && \
pacman -Scc --noconfirm
ADD ./setup.sh /pwndbg/
ADD ./pyproject.toml /pwndbg/
ADD ./poetry.lock /pwndbg/
ADD ./poetry.toml /pwndbg/
# pyproject.toml requires these files, pip install would fail
RUN touch README.md && mkdir pwndbg && touch pwndbg/empty.py
RUN sed -i 's/read -p "Do you want to do a full system update?/#read/' ./setup.sh && \
./setup.sh
# Cleanup dummy files
RUN rm README.md && rm -rf pwndbg
# Comment these lines if you won't run the tests.
ADD ./setup-dev.sh /pwndbg/
RUN ./setup-dev.sh
ADD . /pwndbg/
ENV PATH="${PWNDBG_VENV_PATH}/bin:${PATH}"
RUN echo "source /pwndbg/gdbinit.py" >> ~/.gdbinit.py && \
echo "PYTHON_MINOR=$(python3 -c "import sys;print(sys.version_info.minor)")" >> /root/.bashrc && \
echo "PYTHON_PATH=\"/usr/local/lib/python3.${PYTHON_MINOR}/dist-packages/bin\"" >> /root/.bashrc && \
echo "export PATH=$PATH:$PYTHON_PATH" >> /root/.bashrc