Skip to content

Commit a9a87a1

Browse files
committed
base: Fix i386 APT package dependency hell
One of the i386 packages installed in the base Docker image depends on `python3-minimal` and APT tries to nuke the previously installed `python3` and all its friends, including `software-properties-common`, during the i386 package installation. Marking `python3` and `python3-apt` as held seems to make APT not want to do that, and keeps `python3` and its friends in place without any hacks. This should, hopefully, be the ultimate fix for all the i386 package dependency issues we have come across in the past. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
1 parent 435c972 commit a9a87a1

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

‎Dockerfile.base‎

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ RUN <<EOF
8686
openssh-client \
8787
parallel \
8888
pkg-config \
89+
python3 \
90+
python3-dev \
91+
python3-pip \
92+
python3-ply \
93+
python3-setuptools \
94+
python3-venv \
95+
python-is-python3 \
8996
rsync \
9097
socat \
9198
srecord \
@@ -100,34 +107,22 @@ RUN <<EOF
100107

101108
# Install x86-64 image-specific packages
102109
if [ "${HOSTTYPE}" = "x86_64" ]; then
110+
# Mark `python3` as held because APT otherwise tries to remove it during i386
111+
# package installation.
112+
apt-mark hold python3 python3-apt
113+
103114
# Install multi-lib gcc
104115
apt-get install --no-install-recommends -y \
105116
gcc-multilib \
106117
g++-multilib
107118

108119
# Install 32-bit dependencies
109-
#apt-get install --no-install-recommends -y \
110-
apt-get install -y \
120+
apt-get install --no-install-recommends -y \
111121
libc6-dbg:i386 \
112122
libfuse-dev:i386 \
113123
libsdl2-dev:i386
114-
115-
# Ensure that software-properties-common is installed because
116-
# it may be removed by the above step
117-
apt-get install --no-install-recommends -y \
118-
software-properties-common
119124
fi
120125

121-
# Install Python
122-
apt-get install --no-install-recommends -y \
123-
python3 \
124-
python3-dev \
125-
python3-pip \
126-
python3-ply \
127-
python3-setuptools \
128-
python3-venv \
129-
python-is-python3
130-
131126
# Clean up stale packages
132127
apt-get autoremove --purge -y
133128

0 commit comments

Comments
 (0)