Difference between revisions of "Docker"

From berki WIKI
Jump to: navigation, search
(Create machine)
(Create machine)
Line 45: Line 45:
 
</pre>
 
</pre>
  
{{tip|The machine is created under '''/USER_HOME/.docker/machine/machines/<machine_name>''' directory}}
+
{{tip|The machine is created under '''/USER_HOME/.docker/machine/machines/<machine_name>''' directory
 +
 
 +
If the new VM was created with virtualbox driver, the VirtualBox graphical interface must be started with the same user, that the VM was created with, and the VirtualBox will discover the new VM automatically}}

Revision as of 17:57, 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

If the new VM was created with virtualbox driver, the VirtualBox graphical interface must be started with the same user, that the VM was created with, and the VirtualBox will discover the new VM automatically