首先需要进入容器 docker exec -it 容器名称 bash,然后运行以下两条命令 apt-get update apt-get install -y vim 如果出现apt-get找不到的情况,把apt-get换成yum