docker-容器中安装vim

首先进行apt-get 更新

apt-get update

docker-容器中安装vim_第1张图片

step2

apt-get install vim

 如上面两图所示安装完成。

如果出现下载过慢 的情况可以配置国内的数据源:

参考博客:https://blog.csdn.net/m0_37959155/article/details/122395383

1:进入某个docker容器中:
docker exec -it pgsql12 /bin/bash
2添加:
mv /etc/apt/sources.list /etc/apt/sources.list.bak
    echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >> /etc/apt/sources.list
    echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
    echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list
    echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
2:1
    可以每步分开操作
:/#  mv /etc/apt/sources.list /etc/apt/sources.list.bak
:/#  echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list
/#  echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list
/#  echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list
/#  echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list

4.更新:
apt update
5:安装vim
apt-get install vim

你可能感兴趣的:(docker,容器,运维)