部署背景:由于手边频繁变换的linux操作环境导致需要不停的配置基本的MySQL等开发/技术探索环境,但是通过应用docker自身强大的可移植性很好的解决了这个问题!
Deployment background: The frequently changing linux operating environment at hand leads to the need to constantly configure basic MySQL and other development/technology exploration environment, docker's powerful portability is a good solution to this problem!
目录
1、安装docker
1.1 确认当前环境:
docker -v //查看docker版本,确认发当前docker环境
1.2 安装docker:
apt-get install docker.io
1.3 更换软件源:
系统目录下:etc/docker/daemon.json //没有的话自行创建
更换如下源:
{
“registry-mirrors”:[
“https://docker.mirrors.ustc.edu.cn”,
"https://cr.console.aliyun.com"
]
}
接着:
systemctl restart docker //保存配置,重启docker
systemctl status docker //确认docker运行状态
docker info | find https //验证源
接着:
systemctl enable docker //配置开机自启docker
2、安装/管理镜像
docker search mysql8.0 //查询镜像
docker pull mysql8.0 //拉取镜像
docker images //查看镜像信息,包括镜像ID
*删除镜像:docker rmi [镜像ID] OR docker images rm [镜像ID]