


You can now start Visual Studio Code and open your projects inside the Vagrant VM.
#VAGRANT DOCKER HOW TO#
How to use it on a daily basisĪfter a reboot all you need to do is open a terminal and run: vagrant up If you like you can right click this and select "Remove". If all goes well under "Containers" you'll see the "hello-world" container from earlier. Lastly you should install the Docker extension in Visual Studio Code. Visual Studio Code will now connect to the VM and do some initial setup.Īt this stage you can now use Visual Studio Code to perform all of your tasks in the VM. Now install the Remote SSH extension in VSCode if it's not installed yet.Īfter it installs click the Remote Explorer button, right click VagrantVM and connect to it (you may need to change the view to SSH Targets if you don't see VagrantVM). Run this to set up the SSH connection: vagrant ssh-config -host VagrantVM > ~/.ssh/config Once you're back in the prompt you can run this to test if Docker is working: docker run hello-worldįirst you'll need to set up a normal SSH connection to the VM. Then apply everything by rebooting the VM: exitĪfter that's complete you can connect again with: vagrant ssh Lastly you'll want to make sure the "vagrant" user can run docker commands. Now lets install Docker here: sudo snap install docker If all went well you'll be logged in to your vagrant VM. Wait a moment for Ubuntu 20.04 to be installed then run: vagrant ssh Open a terminal and run: vagrant init ubuntu/focal64 VirtualBox is the VM platform that Vagrant uses. By installing this you'll be up and running much faster. Vagrant is a VM (Virtual Machine) management tool that runs on Mac, Windows and Linux. You prefer to keep your development in a VM.Docker Desktop doesnt work on your system, or you don't prefer to use it.
