MySQL 的 docker 容器中安装 vim

如何在 MySQL 的 docker 容器中安装 vim 以及其他的工具?

先进入 MySQL 容器:

1
docker exec -it <mysql 容器 < span class="built_in">id> bash

配置网易的镜像源

1
2
3
4
5
6
7
8
9
10
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 编辑器

1
apt-get install vim

安装其他的工具亦是如此!