Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : use --no-cache-dir flag to pip in dockerfiles to save space #2357

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions extra/docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ RUN apt-get update \
patchelf \
&& locale-gen en_US.UTF-8 \
&& update-locale LANG=en_US.UTF-8 \
&& PYTHONPATH=`echo /usr/share/python-wheels/pip-*.whl` python2.7 -m pip install --upgrade pip setuptools wheel \
&& python2.7 -m pip install --upgrade pwntools \
&& python3 -m pip install --upgrade pip \
&& python3 -m pip install --upgrade pwntools \
&& PYTHONPATH=`echo /usr/share/python-wheels/pip-*.whl` python2.7 -m pip install --no-cache-dir --upgrade pip setuptools wheel \
&& python2.7 -m pip install --no-cache-dir --upgrade pwntools \
&& python3 -m pip install --no-cache-dir --upgrade pip \
&& python3 -m pip install --no-cache-dir --upgrade pwntools \
&& PWNLIB_NOTERM=1 pwn update \
&& useradd -m pwntools \
&& passwd --delete --unlock pwntools \
Expand Down
4 changes: 2 additions & 2 deletions extra/docker/beta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM pwntools/pwntools:stable

USER root
RUN python2.7 -m pip install --upgrade git+https://github.com/Gallopsled/pwntools@beta \
&& python3 -m pip install --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@beta
RUN python2.7 -m pip install --no-cache-dir --upgrade git+https://github.com/Gallopsled/pwntools@beta \
&& python3 -m pip install --no-cache-dir --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@beta
RUN PWNLIB_NOTERM=1 pwn update
USER pwntools
2 changes: 1 addition & 1 deletion extra/docker/buster/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ RUN apt-get -y dist-upgrade
RUN apt-get -y install python3 python3-pip
RUN apt-get -y install git wget unzip

RUN pip3 install --upgrade git+https://github.com/Gallopsled/pwntools@dev
RUN pip3 install --no-cache-dir --upgrade git+https://github.com/Gallopsled/pwntools@dev
4 changes: 2 additions & 2 deletions extra/docker/stable/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM pwntools/pwntools:base

USER root
RUN python2.7 -m pip install --upgrade git+https://github.com/Gallopsled/pwntools@stable \
&& python3 -m pip install --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@stable
RUN python2.7 -m pip install --no-cache-dir --upgrade git+https://github.com/Gallopsled/pwntools@stable \
&& python3 -m pip install --no-cache-dir --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@stable
RUN PWNLIB_NOTERM=1 pwn update
USER pwntools
16 changes: 8 additions & 8 deletions travis/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ ENV PATH="/home/pwntools/.local/bin:${PATH}"

# Install Pwntools to the home directory, make it an editable install
RUN git clone https://github.com/Gallopsled/pwntools \
&& python2.7 -m pip install --upgrade --editable pwntools \
&& python3 -m pip install --upgrade --editable pwntools \
&& python2.7 -m pip install --no-cache-dir --upgrade --editable pwntools \
&& python3 -m pip install --no-cache-dir --upgrade --editable pwntools \
&& PWNLIB_NOTERM=1 pwn version

# Requirements for running the tests
RUN python2.7 -m pip install --upgrade --requirement pwntools/docs/requirements.txt \
&& python3 -m pip install --upgrade --requirement pwntools/docs/requirements.txt
RUN python2.7 -m pip install --no-cache-dir --upgrade --requirement pwntools/docs/requirements.txt \
&& python3 -m pip install --no-cache-dir --upgrade --requirement pwntools/docs/requirements.txt

# Python niceties for debugging
RUN python2.7 -m pip install -U ipython ipdb \
&& python3 -m pip install -U ipython ipdb
RUN python2.7 -m pip install --no-cache-dir -U ipython ipdb \
&& python3 -m pip install --no-cache-dir -U ipython ipdb

# Dependencies from .travis.yml addons -> apt -> packages
ARG DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -86,8 +86,8 @@ ADD ipython_config.py /home/pwntools/.ipython/profile_default
RUN echo "pwntools ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/travis

# Some additional debugging tools that are useful
RUN python2.7 -m pip install ipdb && \
python3 -m pip install ipdb
RUN python2.7 -m pip install --no-cache-dir ipdb && \
python3 -m pip install --no-cache-dir ipdb

# Install debugging utilities
USER root
Expand Down
4 changes: 2 additions & 2 deletions travis/docker/Dockerfile.travis
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Some additional debugging tools that are useful
RUN python2.7 -m pip install ipdb && \
python3 -m pip install ipdb
RUN python2.7 -m pip install --no-cache-dir ipdb && \
python3 -m pip install --no-cache-dir ipdb

# Install debugging utilities
USER root
Expand Down