Now, we can run docker commands in the VM by first referencing multipass, e.g. For host-machine access, we will alias the docker command to the host as follows: multipass alias docker-vm:docker Our VM is now ready, but we currently can only access the docker instance from within the VM.
Once the VM has finished its installation process, it will automatically download and install docker on that VM. In Terminal, run the following cloud-init code to create a new VM called docker-vm with docker engine installed: multipass launch -cloud-init -disk 40G -mem 4G -cpus 4 -name docker-vm <
Alias the docker command to the host command line.Install Multipass (if not already installed).In this tutorial, we will run the Docker Hello World container within a Multipass VM, from the host command line. This allows you to run Docker locally on your Windows or Mac machine directly from your host terminal.
That Docker instance can be controlled either directly from the VM, or remotely from the host machine with no additional software required. Multipass can host a docker engine inside an Ubuntu VM in a manner similar to Docker Desktop.
If you’re looking for an alternative to Docker Desktop or to integrate Docker into your Multipass workflow, this how-to is for you.