docker容器中安装vim

docker容器中安装vim

在使用docker容器时,容器一般没有安装vim,就需要安装vim
apt-get install vim命令用于安装vim,但是下载过慢。

第一步 配置国内镜像源
进入某个容器
例如进入mysql

docker exec -it mysql /bin/bash


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

第二步:更新源

apt update

第三步安装vim

apt-get install vim

你可能感兴趣的:(java,docker,vim,linux,后端,redis)