Why does Vim in Ubuntu 20.04 require Python 3?

I'm using Docker, and my dockerfile is:

######################################################
FROM ubuntu:20.04

WORKDIR /opt/test

# Apt installs
RUN apt update

######################################################

If I build and run the container, and then run the following, it asks to install python3-minimal, and Python dependencies:

$ docker run -it ubuntu-test
root@3a13a90d3e86:/opt/test# apt install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  alsa-topology-conf alsa-ucm-conf file libasound2 libasound2-data libcanberra0 libexpat1 libgpm2 libltdl7 libmagic-mgc libmagic1 libmpdec2 libogg0 libpython3.8 libpython3.8-minimal libpython3.8-stdlib libreadline8 libsqlite3-0
  libssl1.1 libtdb1 libvorbis0a libvorbisfile3 mime-support readline-common sound-theme-freedesktop vim-common vim-runtime xxd xz-utils
Suggested packages:
  libasound2-plugins alsa-utils libcanberra-gtk0 libcanberra-pulse gpm readline-doc ctags vim-doc vim-scripts
The following NEW packages will be installed:
  alsa-topology-conf alsa-ucm-conf file libasound2 libasound2-data libcanberra0 libexpat1 libgpm2 libltdl7 libmagic-mgc libmagic1 libmpdec2 libogg0 libpython3.8 libpython3.8-minimal libpython3.8-stdlib libreadline8 libsqlite3-0
  libssl1.1 libtdb1 libvorbis0a libvorbisfile3 mime-support readline-common sound-theme-freedesktop vim vim-common vim-runtime xxd xz-utils
0 upgraded, 30 newly installed, 0 to remove and 25 not upgraded.
Need to get 14.9 MB of archives.
After this operation, 70.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] n

These files are in the list: libpython3.8 libpython3.8-minimal libpython3.8-stdlib

Why does Vim require Python?

(This is messing up my Docker image, because I actually need Vim, but I also need 32-bit Python. So I need python3:i386, but Vim is messing it up by installing 64-bit Python too).


Solution 1:

I would guess that the package vim is compiled with support for python. You might have better luck installing the package vim-tiny.

Solution 2:

This is not new in 20.04. The same is true in 18.04 (with Python 3.6 instead, of course). And in 16.04, once a regression was fixed (LP #1574897). Even back in 12.04, the vim package depended on Python (2.7 at the time). This supports Python scripting inside Vim.

Solution 3:

The developer listed it as required - https://packages.ubuntu.com/focal/vim

Your option could also be to use vi instead

https://packages.ubuntu.com/focal/nvi

which shows no python3 requirement.