Changes

Jump to: navigation, search

Docker

5 bytes added, 21:43, 22 June 2018
Manage VMs with docker-machine
==Install software==
 
First we have to install the docker-machine app itself:
<pre>
base=https://github.com/docker/machine/releases/download/v0.14.0 &&
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
sudo install /tmp/docker-machine /usr/local/bin/docker-machine
</pre>
 
 
Secondly we have to install the hypervisor driver for the docker-machine to be able to create, manage Virtual Machines running on the hypervisor. As we are going to use the KVM hypervisor, we have to install the "docker-machine-driver-kvm" driver:
<pre>
# curl -Lo docker-machine-driver-kvm \
https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.7.0/docker-machine-driver-kvm \
&& chmod +x docker-machine-driver-kvm \
&& sudo mv docker-machine-driver-kvm /usr/local/bin
</pre>
 
We suppose that KVM and the libvirt is already installed on the system.
{{tip|If you want to use VirtualBox as your hypervisor, no extra steps are needed, as its docker-machine driver is included in the docker-machine app}}
 
 
Available 3rd party drivers: <br>
https://github.com/docker/docker.github.io/blob/master/machine/AVAILABLE_DRIVER_PLUGINS.md
<br>
<br>
==Create machines==
===Create the KVM netwrok===
Before a new machine can be created with the docker-machine command, the proper KVM virtual network must be created.
See [[KVM#Add_new_networ|How to create KVM networks]] for details.==Hypervisor drivers==
===Create machineWhat are drivers===
Machine can be created with the '''docker-machine create''' command.
Most simple usage:
Here is a complete list of the currently available drivers: https://github.com/docker/docker.github.io/blob/master/machine/AVAILABLE_DRIVER_PLUGINS.md
 
===KVM driver===
*--kvm-io-mode-url Sets the disk io mode of the kvm machine. Defaults to threads.
 ==Install software== First we have to install the docker-machine app itself: <pre>base=https://github.com/docker/machine/releases/download/v0.14.0 && curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine && sudo install /tmp/docker-machine /usr/local/bin/docker-machine</pre>  Secondly we have to install the hypervisor driver for the docker-machine to be able to create, manage Virtual Machines running on the hypervisor. As we are going to use the KVM hypervisor, we have to install the "docker-machine-driver-kvm" driver: <pre># curl -Lo docker-machine-driver-kvm \ https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.7.0/docker-machine-driver-kvm \ && chmod +x docker-machine-driver-kvm \ && sudo mv docker-machine-driver-kvm /usr/local/bin</pre> We suppose that KVM and the libvirt is already installed on the system.{{tip|If you want to use VirtualBox as your hypervisor, no extra steps are needed, as its docker-machine driver is included in the docker-machine app}}  Available 3rd party drivers: <br>https://github.com/docker/docker.github.io/blob/master/machine/AVAILABLE_DRIVER_PLUGINS.md<br><br> ==Create machine machines with KVM== ===Create the machine=== Before a new machine can be created with the docker-machine command, the proper KVM virtual network must be created.  See [[KVM#Add_new_networ|How to create KVM networks]] for details. 
<pre>
# docker-machine create -d kvm --kvm-network "docker-network" manager

Navigation menu