一、安装Linux环境
1、安装Oracle VM VirtualBox
2、安装vagrant
3、下载Linux系统box
。下载地:https://app.vagrantup.com/boxes/search?page=2 这里我选的是Ubuntu16:https://app.vagrantup.com/bento/boxes/ubuntu-16.04
4、添加系统和启动
title:系统名字 URL:系统路径
。vagrant box add {title} {url} (添加box)
。vagrant init {title} (初始化box)
。vagrant up (启动系统)
5、连接到虚拟机
。vagrant ssh (默认密码为vagrant)
。修改成root登录:https://blog.csdn.net/cbcxvbfxgb/article/details/106868092 (这种方式登录用ssh root@xxxx.x.x.x -p xxxx 方式)
二、安装docker
1、卸载老的docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
2、设置存储库
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
3、安装docker
sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin 如果提示接受 GPG 密钥,请验证指纹是否匹配 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35,如果是,则接受它。
如果提示[Errno 14] curl#35 - "Network file descriptor is not connected"
执行:rpm --
import
http:
//mirrors
.163.com
/centos/RPM-GPG-KEY-CentOS-7
4、启动docker
sudo systemctl start docker
三、安装docker-compose
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} mkdir -p $DOCKER_CONFIG/cli-plugins curl -SL https://github.com/docker/compose/releases/download/v2.4.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version