Difference between revisions of "Docker"

From berki WIKI
Jump to: navigation, search
(Manage machines)
(Create machine)
Line 39: Line 39:
 
</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}}

Revision as of 17:47, 22 June 2018

Manage VMs with docker-machine

Introduction

Install software

Manage machines

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 interface will be created for every new VM.

  • one for the virtual network provided by 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-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