Ubuntu上安装docker及下载mysql
ubuntu版本 18.04.5-desktop-amd64
- 下载vim
- 更换Ubuntu内置的源
- 安装需要使用到的软件
sudo apt install apt-transport-https ca-certificates curl software-properties-common
- 将docker官方库的gpa秘钥添加至系统
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- 添加docker软件仓库
清华源:
sudo add-apt-repository \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"
官方源:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
- 更新repo源
- 下载docker
sudo apt-get install docker-ce docker-ce-cli containerd.io
- 更新docker镜像源
- 在/etc/docker/daemon.json目录下更改docker地址(没有此目录及文件手动创建)
# /etc/docker/daemon.json
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/","https://hub-mirror.c.163.com","https://registry.docker-cn.com"],
"insecure-registries": ["10.0.0.12:5000"]
}
- 测试
sudo docker run hello-world
- 下载mysql
docker pull mysql:8.0.26