Skip to content

Commit e3922a1

Browse files
author
Yadav Lamichhane
committed
docker-machine overview
1 parent f477c9e commit e3922a1

File tree

1 file changed

+42
-38
lines changed

1 file changed

+42
-38
lines changed

intermediate/docker-machine/README.md

+42-38
Original file line numberDiff line numberDiff line change
@@ -8,76 +8,80 @@ Docker machine is a tool which lets you to install docker engine in remote hosts
88

99
You can install docker-machine in various flavours of linux operating system and since I am using fedora so this file contain installation steps required to install in it.
1010

11-
Install [Docker](https://docs.docker.com/install/)
11+
1. Install [Docker](https://docs.docker.com/install/)
1212

13-
Execute the following command which download the docker-machine binary and put it into your $PATH.
13+
2. Execute the following command which download the docker-machine binary and put it into your $PATH.
1414

15-
```
16-
base=https://github.com/docker/machine/releases/download/v0.16.0 &&
17-
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
18-
sudo mv /tmp/docker-machine /usr/local/bin/docker-machine &&
19-
chmod +x /usr/local/bin/docker-machine
15+
```
16+
base=https://github.com/docker/machine/releases/download/v0.16.0 &&
17+
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
18+
sudo mv /tmp/docker-machine /usr/local/bin/docker-machine &&
19+
chmod +x /usr/local/bin/docker-machine
20+
```
2021

21-
```
22+
3. Verify the installation
2223

23-
Verify the installation
24-
25-
```
26-
docker-machine version
27-
28-
```
24+
```
25+
docker-machine version
26+
```
2927

3028
For installation of docker-machine in other operating systems, kindly follow the [Official Documentation](https://docs.docker.com/machine/install-machine/).
3129

3230
## Driver dependency
3331

3432
For using docker-machine to create, use and manage the docker host locally, you should have virtualization driver installed in your system. There are different drivers availabe which supports docker-machine depending upon the type of virtualizaiton technology you use. For KVM, docker-machine use docker-machine-driver-kvm where as for Virtualbox it uses virtualbox driver.
3533

36-
KVM driver
34+
1. KVM driver
3735

38-
Configuring in RHEL/CentOS based system.
36+
- Configuring in RHEL/CentOS based system.
3937

40-
```
41-
curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.10.0/docker-machine-driver-kvm-centos7 \
42-
> /usr/local/bin/docker-machine-driver-kvm \
43-
chmod +x /usr/local/bin/docker-machine-driver-kvm
44-
```
38+
```
39+
curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.10.0/docker-machine-driver-kvm-centos7 \
40+
> /usr/local/bin/docker-machine-driver-kvm \
41+
chmod +x /usr/local/bin/docker-machine-driver-kvm
42+
```
4543

46-
Configuring in Debian based system.
44+
- Configuring in Debian based system.
4745

48-
```
49-
curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.10.0/docker-machine-driver-kvm-ubuntu14.04 \
50-
> /usr/local/bin/docker-machine-driver-kvm \
51-
chmod +x /usr/local/bin/docker-machine-driver-kvm
52-
```
46+
```
47+
curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.10.0/docker-machine-driver-kvm-ubuntu14.04 \
48+
> /usr/local/bin/docker-machine-driver-kvm \
49+
chmod +x /usr/local/bin/docker-machine-driver-kvm
50+
```
5351

54-
VritualBox
52+
2. VritualBox
5553

56-
Virtualbox uses vboxdrv driver and installation is quite simple than that of KVM. Install virtualbox and you are all set to use docker-machine.
54+
Virtualbox uses vboxdrv driver and installation is quite simple than that of KVM. Install virtualbox and you are all set to use docker-machine.
5755

5856
## Provision of docker host locally
5957

60-
To create docker host locally you can simply execute ```docker-machine create docker-vm-name```. This command go forward to create docker virtual machine locally on top of your hypervisor. You can also specify the particular driver for instantiating vm depending upon your requirements i.e.
58+
To create docker host locally you can simply execute ```docker-machine create docker-vm-name```. This command goes forward to create docker virtual machine locally on top of your hypervisor. In palce of docker-vm-name I've used vm1 for simplicity. You can also specify the particular driver for instantiating vm depending upon your requirements, for e.g. to use virtualbox driver you can simply append ```virtualbox``` with ```-d``` as a driver option i.e.
6159

62-
``` docker-machine create -d virtualbox docker_vm_name ```
60+
``` docker-machine create -d virtualbox vm1 ```
6361

6462
You can create as many docker vm as per your requirements. You can use ``` docker-machine ls ``` command to list all the docker machines installed locally. This command also provides information of vm like name, status, driver, state, ip, etc.
6563

66-
To start the stoped docker machine enter ``` docker-machine start docker_machine_name ```
64+
To start the stoped docker_machine, execute:
65+
66+
```
67+
docker-machine start vm1
68+
```
6769

6870
## Running containers on docker machine
6971

70-
After creating docker machine you can execute command from the host system to the docker_machine_name. For this you need to connect your shell to the docker machine.i.e.
72+
After creating docker machine you can execute command from the host system to the vm1. For this you need to connect your shell to the docker machine.i.e.
7173

72-
```eval $(docker-machine env docker_vm_name)```
74+
```eval $(docker-machine env vm1)```
7375

74-
Now you can simply execute the commands in newly created docker_docker_vm from your local system. i.e.
76+
Now you can simply execute the commands in newly created docker_machine_vm from your local system. i.e.
7577

76-
```docker run -it --security-opt seccomp:unconfined ubuntu /bin/bash```
78+
```
79+
docker run -it --security-opt seccomp:unconfined ubuntu /bin/bash
80+
```
7781

78-
This command pull the ubuntu image in docker_machine_name from the docker reigistry and invoke bash terminal from it.
82+
This command pull the ubuntu image in vm1 from the docker reigistry and invoke bash terminal from it.
7983

80-
You can switch between different docker_machine_vm with the help of ```eval``` command.
84+
You can switch between different docker virtual machines with the help of ```eval``` command.
8185

8286

8387

0 commit comments

Comments
 (0)