So I am working on a project using Docker, and I need to install Python.
This was previously working fine when my base container was ubuntu:18.04
The package was insalled like so:
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-
install-recommends \
python \
...
My project will also include Swift, so I changed the base image like so:
FROM swift:5.1
And now I get the following error when apt-get tries to install python:
Errors were encountered while processing: /var/cache/apt/archives/python2.7-minimal_2.7.17-1~18.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
The Dockerfile for swift:5.1 can be found here:
This is also based on ubuntu:18.04 so I suppose the issue must be caused by something in this dockerfile.
My best guess is that perhaps it is because swift:5.1 also installs libpython2.7
What exactly is this error, and how can I avoid it?
edit: here is the context where the error appears:
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../python2.7-minimal_2.7.17-1~18.04_amd64.deb ...
new installation of python2.7-minimal; /usr/lib/python2.7/site-packages is a directory
which is expected a symlink to /usr/local/lib/python2.7/dist-packages.
please find the package shipping files in /usr/lib/python2.7/site-packages and
file a bug report to ship these in /usr/lib/python2.7/dist-packages instead
aborting installation of python2.7-minimal
dpkg: error processing archive /var/cache/apt/archives/python2.7-minimal_2.7.17-1~18.04_amd64.deb (--unpack):
new python2.7-minimal package pre-installation script subprocess returned error exit status 1
Selecting previously unselected package python-minimal.
Preparing to unpack .../python-minimal_2.7.15~rc1-1_amd64.deb ...
Unpacking python-minimal (2.7.15~rc1-1) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../python2.7_2.7.17-1~18.04_amd64.deb ...
Unpacking python2.7 (2.7.17-1~18.04) ...
Selecting previously unselected package libpython-stdlib:amd64.
Preparing to unpack .../libpython-stdlib_2.7.15~rc1-1_amd64.deb ...
Unpacking libpython-stdlib:amd64 (2.7.15~rc1-1) ...
Errors were encountered while processing:
/var/cache/apt/archives/python2.7-minimal_2.7.17-1~18.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)