登录到宿主机器
docker ps
![](https://i-blog.csdnimg.cn/blog_migrate/c0e334c88a530df7c724a16d05797e15.png)
mark
从列表找到你要操作的镜像对应的id,替换下面命令中的id.
docker -it exec {id} /bin/bash
执行如
docker exec -it ec193ea30766 /bin/bash
就可以进入的镜像
如果未安装 vi/vim,这里使用的是vim
docker安装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
然后apt-get install -y vim
后面就可以在镜像中,在对应的js文件,增加一些临时的调试信息了
vim /asset/js/app.js
退出相应的镜像 Ctrl +d