在Docker容器中安装vim

1.首先进入容器

docker exec -ti 容器名称 /bin/bash

例如:docker exec -ti nginx /bin/bash

2.接下来更新下apt-get的源。把下面的命令全部复制粘到容器的控制台执行:

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

现在就能安装软件了:

3.执行命令:

apt-get update && apt-get install vim -y

在Docker容器中安装vim

上一篇:【Rustdesk】最友好的开源远程桌面软件——Rustdesk 实现 Windows、Linux、MacOS 之间远程连接桌面


下一篇:Ubuntu16.04下安装cuckoo布谷鸟沙箱