Skip to content

Commit cd34349

Browse files
committed
Don't upgrade pip anymore and --break-system-packages
Pip doesn't have a RECORD file anymore and fails to uninstall / upgrade on latest Ubuntu now. --force-reinstall on pwntools causes pip to upgrade too since it's in our dependencies, which fails too. As a workaround uninstall pwntools manually before upgrading.
1 parent 3eb690b commit cd34349

File tree

7 files changed

+12
-21
lines changed

7 files changed

+12
-21
lines changed

extra/docker/base/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ RUN apt-get update \
3838
patchelf \
3939
&& locale-gen en_US.UTF-8 \
4040
&& update-locale LANG=en_US.UTF-8 \
41-
&& python3 -m pip install --no-cache-dir --upgrade pip \
42-
&& python3 -m pip install --no-cache-dir --upgrade pwntools \
41+
&& python3 -m pip install --no-cache-dir --break-system-packages --upgrade pwntools \
4342
&& PWNLIB_NOTERM=1 pwn update \
4443
&& useradd -m pwntools \
4544
&& passwd --delete --unlock pwntools \

extra/docker/beta/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM pwntools/pwntools:stable
22

33
USER root
4-
RUN python3 -m pip install --no-cache-dir --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@beta
4+
RUN python3 -m pip uninstall --break-system-packages -q -y pwntools && python3 -m pip install --no-cache-dir --break-system-packages --upgrade git+https://github.com/Gallopsled/pwntools@beta
55
RUN PWNLIB_NOTERM=1 pwn update
66
USER pwntools

extra/docker/dev/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM pwntools/pwntools:stable
22

33
USER root
4-
RUN python3 -m pip install --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@dev
4+
RUN python3 -m pip uninstall --break-system-packages -q -y pwntools && python3 -m pip install --no-cache-dir --break-system-packages --upgrade git+https://github.com/Gallopsled/pwntools@dev
55
RUN PWNLIB_NOTERM=1 pwn update
66
USER pwntools

extra/docker/develop/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ENV HISTFILE=/home/pwntools/.history
55

66
# Uninstall existing versions of pwntools
77
USER root
8-
RUN python3 -m pip uninstall -q -y pwntools
8+
RUN python3 -m pip uninstall --break-system-packages -q -y pwntools
99

1010
# Switch back to the pwntools user from here forward
1111
USER pwntools
@@ -17,14 +17,14 @@ ENV PATH="/home/pwntools/.local/bin:${PATH}"
1717

1818
# Install Pwntools to the home directory, make it an editable install
1919
RUN git clone https://github.com/Gallopsled/pwntools \
20-
&& python3 -m pip install --upgrade --editable pwntools \
20+
&& python3 -m pip install --break-system-packages --upgrade --editable pwntools \
2121
&& PWNLIB_NOTERM=1 pwn version
2222

2323
# Requirements for running the tests
24-
RUN python3 -m pip install --upgrade --requirement pwntools/docs/requirements.txt
24+
RUN python3 -m pip install --break-system-packages --upgrade --requirement pwntools/docs/requirements.txt
2525

2626
# Python niceties for debugging
27-
RUN python3 -m pip install -U ipython ipdb
27+
RUN python3 -m pip install --break-system-packages -U ipython ipdb
2828

2929
# Dependencies from .travis.yml addons -> apt -> packages
3030
ARG DEBIAN_FRONTEND=noninteractive

extra/docker/stable/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM pwntools/pwntools:base
22

33
USER root
4-
RUN python3 -m pip install --no-cache-dir --force-reinstall --upgrade git+https://github.com/Gallopsled/pwntools@stable
4+
RUN python3 -m pip uninstall --break-system-packages -q -y pwntools && python3 -m pip install --no-cache-dir --break-system-packages --upgrade git+https://github.com/Gallopsled/pwntools@stable
55
RUN PWNLIB_NOTERM=1 pwn update
66
USER pwntools

travis/docker/Dockerfile

+4-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ENV HISTFILE=/home/pwntools/.history
55

66
# Uninstall existing versions of pwntools
77
USER root
8-
RUN python3 -m pip uninstall -q -y pwntools
8+
RUN python3 -m pip uninstall --break-system-packages -q -y pwntools
99

1010
# Switch back to the pwntools user from here forward
1111
USER pwntools
@@ -17,14 +17,14 @@ ENV PATH="/home/pwntools/.local/bin:${PATH}"
1717

1818
# Install Pwntools to the home directory, make it an editable install
1919
RUN git clone https://github.com/Gallopsled/pwntools \
20-
&& python3 -m pip install --upgrade --editable pwntools \
20+
&& python3 -m pip install --break-system-packages --upgrade --editable pwntools \
2121
&& PWNLIB_NOTERM=1 pwn version
2222

2323
# Requirements for running the tests
24-
RUN python3 -m pip install --upgrade --requirement pwntools/docs/requirements.txt
24+
RUN python3 -m pip install --break-system-packages --upgrade --requirement pwntools/docs/requirements.txt
2525

2626
# Python niceties for debugging
27-
RUN python3 -m pip install -U ipython ipdb
27+
RUN python3 -m pip install --break-system-packages -U ipython ipdb
2828

2929
# Dependencies from .travis.yml addons -> apt -> packages
3030
ARG DEBIAN_FRONTEND=noninteractive
@@ -80,10 +80,6 @@ ADD ipython_config.py /home/pwntools/.ipython/profile_default
8080

8181
# Do not require password for sudo
8282
RUN echo "pwntools ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/travis
83-
84-
# Some additional debugging tools that are useful
85-
RUN python3 -m pip install --no-cache-dir ipdb
86-
8783
# Install debugging utilities
8884
USER root
8985
RUN apt-get -y install gdb gdbserver tmux gdb-multiarch

travis/docker/Dockerfile.travis

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
2-
# Some additional debugging tools that are useful
3-
RUN python3 -m pip install --no-cache-dir ipdb
4-
51
# Install debugging utilities
62
USER root
73
RUN apt-get -y install gdb gdbserver tmux gdb-multiarch

0 commit comments

Comments
 (0)