docker pull centos
docker run --name tools -itd -p 2201:22 -p 8080:80 -v ./workspace:/workspace --privileged centos /usr/sbin/init
docker exec -it tools bash
# 设置yum源
cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
# 安装 sshd 服务
yum install -y openssh-server
systemctl start sshd
systemctl enable sshd
# 安装密码管理器
yum install -y passwd
passwd root
# 安装 make
yum install -y make
# 安装 docker
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# 启动docker
systemctl start docker
systemctl enable docker