docker镜像安装vim
apt-get install vim
命令用于安装vim,但是下载过慢。第一步 配置国内镜像源
进入某个镜像
docker images
docker run -it 73af4f97af3f /bin/bash (需要记住这个容器id)
配置镜像源
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
第二步:下载vim
apt update
apt-get install vim
修改bmv2镜像的stratum.py文件
sed -i "s#-bmv2_log_level=%s' % self.loglevel#-bmv2_log_level trace'#g" stratum.py
sed -i 's/-logtosyslog=false/-logtosyslog=true/g' stratum.py
第三步:创建新的镜像
docker commit -m="modify stratum.py" -a "gejuncheng" 24eeb3c1811f opennetworking/ngsdn-tutorial:stratum_bmv2
各个参数说明:
-
-m: 提交的描述信息
-
-a: 指定镜像作者
-
24eeb3c1811f :容器 ID
-
opennetworking/ngsdn-tutorial:stratum_bmv2: 指定要创建的目标镜像名:tag名
我们可以使用 docker images 命令来查看我们的新镜像 opennetworking/ngsdn-tutorial:stratum_bmv2: