docker 映象下安裝Vim
阿新 • • 發佈:2019-01-08
在docker映象執行以後發現沒辦法編輯一些配置檔案,解決步驟如下:
首先,進入docker映象
#進入映象命令
docker exec -it 映象Id或映象name /bin/bash
配置國內映象源
實際在使用過程中,執行 apt-get update,然後執行 apt-get install -y vim,下載地址由於是海外地址,下載速度異常慢而且可能中斷更新流程,所以做下面配置:
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-get update
安裝vim
#安裝命令
apt-get install -y vim