Sunday, August 14, 2022

ubuntu 20.04 with docker

 

Vagrant.configure("2") do |config|
    # For a complete reference, please see the online documentation at
    # https://docs.vagrantup.com.
  
    # This refers to a local `.box` file which should have been generated by running sets in README.md
    config.vm.box = "bento/ubuntu-20.04"
    config.vm.network "private_network", ip: "192.168.35.48"
  
    # Vagrant has a default synced folder which you might choose to disable
    config.vm.synced_folder ".", "/vagrant"
  
    # This custom built box is not setup to support updates anyway, hence they are been disabled
    config.vm.box_check_update = false
    config.disksize.size = '50GB'

   config.vm.provision "shell", inline: <<-SHELL
     apt-get update -y
     apt-get install -y nano
	 sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
	 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
	 echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
	 apt-get update -y
	 apt-get install docker-ce docker-ce-cli containerd.io -y
	 systemctl enable docker
	 groupadd docker
	 usermod -aG docker vagrant
	 newgrp docker
   SHELL
  
  end

No comments:

Post a Comment