我正在使用 Docker,我的docker文件是:
######################################################
FROM ubuntu:20.04
WORKDIR /opt/test
# Apt installs
RUN apt update
######################################################
如果我构建并运行容器,然后运行以下命令,它会要求安装 python3-minimal 和 Python 依赖项:
$ 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
这些文件在列表中:
libpython3.8 libpython3.8-minimal libpython3.8-stdlib
为什么 Vim 需要 Python?
(这弄乱了我的 Docker 镜像,因为我实际上需要 Vim,但我也需要 32 位 Python。所以我需要 python3:i386,但是 Vim 也通过安装 64 位 Python 弄乱了它)。
答案1
我猜这个包裹vim
是编译时已支持对于 python。您可能更幸运地安装了该包vim-tiny
。
答案2
这在 20.04 中并不新鲜。18.04(当然是用 Python 3.6). 并且在16.04, 一旦回归已修复(LP #1574897)。甚至早在 12.04 版中,包裹vim
依赖于 Python (当时是 2.7)。这支持在 Vim 中使用 Python 脚本。
答案3
开发人员按要求列出了它 -https://packages.ubuntu.com/focal/vim
你也可以选择vi
使用
https://packages.ubuntu.com/focal/nvi
这表明不需要 python3。