代码拉取完成,页面将自动刷新
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.box_check_update = false
config.ssh.insert_key = false
# insecure_private_key download from https://github.com/hashicorp/vagrant/blob/master/keys/vagrant
config.ssh.private_key_path = "insecure_private_key"
my_machines = {
'vm' => '192.168.66.100',
'vm1' => '192.168.66.101',
}
my_machines.each do |name, ip|
config.vm.define name do |machine|
machine.vm.network "private_network", ip: ip
machine.vm.hostname = name
machine.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--vram", "128"]
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--memory", "3072"]
end
machine.vm.provision "shell", inline: <<-SHELL
echo "root:vagrant" | sudo chpasswd
timedatectl set-timezone "Asia/Shanghai"
curl -fsSL https://mirror.ghproxy.com/https://github.com/dyrnq/install-docker/raw/main/install-docker.sh | bash -s docker \
--mirror tencent \
--version 25.0.4 \
--systemd-mirror ghproxy && \
usermod -aG docker vagrant
docker ps
SHELL
end
end
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。