Difference between revisions of "Docker"

From berki WIKI
Jump to: navigation, search
(Create the KVM netwrok)
(Create machine)
Line 19: Line 19:
 
docker-machine create -d <hybervisor driver name> --<hypervisor options> <>
 
docker-machine create -d <hybervisor driver name> --<hypervisor options> <>
 
</pre>
 
</pre>
 +
 
* -d: hypervisor driver. Default value: "virtalbox". For KVM use: "kvm".  
 
* -d: hypervisor driver. Default value: "virtalbox". For KVM use: "kvm".  
 
* --kvm-network: The name of the kvm virtual network that we would like to use. If this is not set, the new machine will be connected to the '''"default"''' KVM virtual network.
 
* --kvm-network: The name of the kvm virtual network that we would like to use. If this is not set, the new machine will be connected to the '''"default"''' KVM virtual network.
  
{{note|Even with the --kvn-network parameter provided, two new interface will be created for every new VM.
+
{{note|Even with the --kvn-network parameter provided, two new interfaces are created for every new VM.
* one for the virtual network provided by the --kvm-network parameter
+
* one for the virtual network, described with the --kvm-network parameter
* docker-machines will create a second, isolated virtual network called "'''docker-machines'''", that the new VM will be connected to}}
+
* docker-machines will create a second, isolated virtual network called "'''docker-machines'''", that the new VM is also connected to}}
 +
 
 
<pre>
 
<pre>
 
# docker-machine create -d kvm --kvm-network "docker-network" manager
 
# docker-machine create -d kvm --kvm-network "docker-network" manager

Revision as of 17:55, 22 June 2018

Manage VMs with docker-machine

Introduction

Install software

Manage 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 How to create KVM networks for details.

Create machine

Machine can be created with the docker-machine create command. Most simple usage:

docker-machine create -d <hybervisor driver name> --<hypervisor options> <>
  • -d: hypervisor driver. Default value: "virtalbox". For KVM use: "kvm".
  • --kvm-network: The name of the kvm virtual network that we would like to use. If this is not set, the new machine will be connected to the "default" KVM virtual network.
ImportantIcon.png

Note
Even with the --kvn-network parameter provided, two new interfaces are created for every new VM.

  • one for the virtual network, described with the --kvm-network parameter
  • docker-machines will create a second, isolated virtual network called "docker-machines", that the new VM is also connected to


# docker-machine create -d kvm --kvm-network "docker-network" manager
Running pre-create checks...
Creating machine...
(manager) Copying /root/.docker/machine/cache/boot2docker.iso to /root/.docker/machine/machines/manager/boot2docker.iso...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env manager
TipIcon.png

Tip
The machine is created under /USER_HOME/.docker/machine/machines/<machine_name> directory