解决方法:权限不够 请使用root权限进入容器: docker exec -u 0 -it 容器名 /bin/bash # 0 表示root 然后再 apt-get update apt-get install vim