Docker容器解决没有vi/vim命令问题

白日放歌须纵酒,青春作伴好还乡。这篇文章主要讲述Docker容器解决没有vi/vim命令问题相关的知识,希望能为你提供帮助。
在进入docker启动的容器中,需要修改配置文件信息,但是发现vi命令不识别,解决办法

1.进入容器
docker exec -it719f072af9d0 /bin/bash

2.命令:apt-get install vim

如果出现如下
root@719f072af9d0:/usr/local/tomcat/webapps/web_demo# apt-get install vim
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package vim

3.命令:apt-get update
出现如下
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 Packages [8183 kB]
Get:4 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
Reading package lists... Done
E: Release file for http://deb.debian.org/debian/dists/bullseye-updates/InRelease is not valid yet (invalid for another 6d 12h 41min 35s). Updates for this repository will not be applied.
E: Release file for http://security.debian.org/debian-security/dists/bullseye-security/InRelease is not valid yet (invalid for another 6d 11h 42min 9s). Updates for this repository will not be applied.

4.命令:apt-get install vim再次执行一次

OK完成

【Docker容器解决没有vi/vim命令问题】


    推荐阅读