SlideShare a Scribd company logo
1 of 33
Todays agenda
● What is docker-machine?
● Which one to use? docker-machine vs
docker remote?
● Quiz
Docker deployment on [physical]host
Docker deployment on any hosts
Cool, can deploy it on many hosts the same way. But..
● manage through ssh on each server
● if new server comes up, install os, configure
stuff, install and manage dockers
● if it is cloud service, manage vendor specific
cloud service since they are heterogeneous
● CRUD operations on VMs requires the
development of SDK or vendor specific
managements
So here comes...
T800
No...this one
Docker-machine
So what does it do? ...in short
● maps local docker cmd to docker command
on remote machine
● execute the same commands you could do
locally on remote machine
● execute CRUD operations on VMs
● switch between hosts: physical, virtual or
cloud seamlessly
Prerequisites
1. VirtualBox
2. docker-engine
3. access to internet
Install docker-machine on Linux
curl -L
https://github.com/docker/machine/releases/do
wnload/v0.3.0/docker-machine_linux-amd64 >
/usr/local/bin/docker-machine
Install docker-machine on MacOS
curl -L
https://github.com/docker/machine/releases/do
wnload/v0.3.0/docker-machine_darwin-amd64
> /usr/local/bin/docker-machine
Install docker-machine on Windows
Go here and download version for your
platform:
https://docs.docker.com/machine/
Hello docker-machine
docker-machine create --driver virtualbox dev1
docker-machine ls
eval "$(docker-machine env dev1)"
docker run busybox echo hello world
Hello docker-machine again
docker-machine create --driver virtualbox dev2
docker-machine ls
eval "$(docker-machine env dev2)"
docker run busybox echo hello world
So what we have?
If you do “docker-machine ps” you will have to
different machines with one containers inside.
A bit real example
docker-machine create --driver virtualbox
webapp
docker-machine ls
eval "$(docker-machine env webapp)"
docker run -d -p 80:80 nginx
So what is this ---driver?
Docker-machine works with VMs and dockers
inside it. Since the VMs can be on hosted
servers, virtual or cloud, it provides drivers that
lets to work with each one the way they require.
Diving to docker-machine create --help
Yeah it’s very long
docker-machine create --help | wc -l
gives 157 options!!!
Filtering the option by driver
docker-machine create -d <driver_name>
gives options only for specified driver filtering out unrelated options
Example: filter for AWS
docker-machine create -d amazonec2
Example: filter for AWS
docker-machine create -d amazonec2
Lab work: Create docker on digitalocean
Create VM with running nginx on digitalocean
using docker-machine help
Access token:
<access token>
Remove those machines, NOW!
docker-machine rm <machine_name>
docker-machine ls
What about connecting to physical servers?
To connect to local physical or virtual servers there are two ways:
1) by creating driverless VM
2) by creating using generic driver
For the first option there needs to be takes additional steps where you need to
create CA certificates using OpenSSL by following article written here
https://docs.docker.com/articles/https/
For the second option what is required is to put your public keys on physical or
virtual server
Lab work: Create generic VM to connect to server
Using docker-machine help create vm with
generic driver
Host IP:
192.168.10.112
What about docker remote?
export DOCKER_HOST=tcp://<remote_id>:<port>
docker run -d -p 80:80 nginx
Quiz
What is the difference between docker and docker-
machine?
1) no difference. docker has remote api
2) docker is the client of docker-machine
3) docker-machine organizes vm and manages dockers
inside
4) docker-machine is the manager of cloud vm for dockers
Quiz
What is the difference between docker and docker-
machine?
1) no difference. docker has remote api
2) docker is the client of docker-machine
3) docker-machine organizes vm and manages dockers
inside
4) docker-machine is the manager of cloud vm for dockers
Quiz
Describe the ways of creating docker VMs to
connect to host machines.
Quiz
How many dockers can I create inside VM
created by docker-machine?
Quiz
What is the difference between VM created with --generic
driver and --virtualbox driver?
1. No difference. Difference only in driver names
2. IPs are different
3. After creating generic requires SSH access, whereas virtualbox SSH
access is generated by docker-machine
4. When you remove virtualbox VM it removes all the data files, whereas
generic removes only vm
Quiz
What is the difference between VM created with --generic
driver and --virtualbox driver?
1. No difference. Difference only in driver names
2. IPs are different
3. After creating generic requires SSH access, whereas virtualbox SSH
access is generated by docker-machine
4. When you remove virtualbox VM it removes all the data files, whereas
generic removes only vm

More Related Content

What's hot

Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad
Docker, Inc.
 
Easy Docker on Microsoft Azure
Easy Docker on Microsoft AzureEasy Docker on Microsoft Azure
Easy Docker on Microsoft Azure
Docker, Inc.
 

What's hot (20)

Nebulaworks Docker Overview 09-22-2015
Nebulaworks Docker Overview 09-22-2015Nebulaworks Docker Overview 09-22-2015
Nebulaworks Docker Overview 09-22-2015
 
Dockerin10mins
Dockerin10minsDockerin10mins
Dockerin10mins
 
Wordcamp Bratislava 2017 - Docker! Why?
Wordcamp Bratislava 2017 - Docker! Why?Wordcamp Bratislava 2017 - Docker! Why?
Wordcamp Bratislava 2017 - Docker! Why?
 
Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad
 
DockerDay2015: Docker orchestration for sysadmin
DockerDay2015: Docker orchestration for sysadminDockerDay2015: Docker orchestration for sysadmin
DockerDay2015: Docker orchestration for sysadmin
 
Docker Workshop for beginner
Docker Workshop for beginnerDocker Workshop for beginner
Docker Workshop for beginner
 
How we dockerized a startup? #meetup #docker
How we dockerized a startup? #meetup #docker How we dockerized a startup? #meetup #docker
How we dockerized a startup? #meetup #docker
 
Docker Started
Docker StartedDocker Started
Docker Started
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
 
Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017Why Docker? Dayton PHP, April 2017
Why Docker? Dayton PHP, April 2017
 
Docker, Docker Swarm mangement tool - Gorae
Docker, Docker Swarm mangement tool - GoraeDocker, Docker Swarm mangement tool - Gorae
Docker, Docker Swarm mangement tool - Gorae
 
Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralove
 
Docker Swarm Meetup (15min lightning)
Docker Swarm Meetup (15min lightning)Docker Swarm Meetup (15min lightning)
Docker Swarm Meetup (15min lightning)
 
Docker and CloudStack
Docker and CloudStackDocker and CloudStack
Docker and CloudStack
 
Docker swarm reloaded
Docker swarm reloadedDocker swarm reloaded
Docker swarm reloaded
 
Easy Docker on Microsoft Azure
Easy Docker on Microsoft AzureEasy Docker on Microsoft Azure
Easy Docker on Microsoft Azure
 
Consuming Cinder from Docker
Consuming Cinder from DockerConsuming Cinder from Docker
Consuming Cinder from Docker
 
Microservices using relocatable Docker containers
Microservices using relocatable Docker containersMicroservices using relocatable Docker containers
Microservices using relocatable Docker containers
 
Docker - introduction
Docker - introductionDocker - introduction
Docker - introduction
 

Similar to Docker-machine

Part 4 Docker Concepts - Docker Machine
Part 4 Docker Concepts - Docker MachinePart 4 Docker Concepts - Docker Machine
Part 4 Docker Concepts - Docker Machine
Biswajit De
 
Automating Dev Environment - Introduction to Docker and Chef
Automating Dev Environment - Introduction to Docker and ChefAutomating Dev Environment - Introduction to Docker and Chef
Automating Dev Environment - Introduction to Docker and Chef
kamalikamj
 
RootConf 2014 Bangalore: Automating the Dev Environment - Introduction to Do...
 RootConf 2014 Bangalore: Automating the Dev Environment - Introduction to Do... RootConf 2014 Bangalore: Automating the Dev Environment - Introduction to Do...
RootConf 2014 Bangalore: Automating the Dev Environment - Introduction to Do...
Thoughtworks
 

Similar to Docker-machine (20)

Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班
 
Docker toolbox
Docker toolboxDocker toolbox
Docker toolbox
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4
 
Docker
DockerDocker
Docker
 
Docker 101
Docker 101Docker 101
Docker 101
 
Part 4 Docker Concepts - Docker Machine
Part 4 Docker Concepts - Docker MachinePart 4 Docker Concepts - Docker Machine
Part 4 Docker Concepts - Docker Machine
 
Introduction To Docker
Introduction To  DockerIntroduction To  Docker
Introduction To Docker
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Hero
 
containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )
 
Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4
 
Docker fundamentals
Docker fundamentalsDocker fundamentals
Docker fundamentals
 
Docker container a-brief_introduction_2016-01-30
Docker container a-brief_introduction_2016-01-30Docker container a-brief_introduction_2016-01-30
Docker container a-brief_introduction_2016-01-30
 
Automating Dev Environment - Introduction to Docker and Chef
Automating Dev Environment - Introduction to Docker and ChefAutomating Dev Environment - Introduction to Docker and Chef
Automating Dev Environment - Introduction to Docker and Chef
 
RootConf 2014 Bangalore: Automating the Dev Environment - Introduction to Do...
 RootConf 2014 Bangalore: Automating the Dev Environment - Introduction to Do... RootConf 2014 Bangalore: Automating the Dev Environment - Introduction to Do...
RootConf 2014 Bangalore: Automating the Dev Environment - Introduction to Do...
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
 
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyClustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
 
Docker
DockerDocker
Docker
 
Docker 1.9 Workshop
Docker 1.9 WorkshopDocker 1.9 Workshop
Docker 1.9 Workshop
 
Docker Swarm & Machine
Docker Swarm & MachineDocker Swarm & Machine
Docker Swarm & Machine
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Docker-machine

  • 1.
  • 2. Todays agenda ● What is docker-machine? ● Which one to use? docker-machine vs docker remote? ● Quiz
  • 3. Docker deployment on [physical]host
  • 5. Cool, can deploy it on many hosts the same way. But.. ● manage through ssh on each server ● if new server comes up, install os, configure stuff, install and manage dockers ● if it is cloud service, manage vendor specific cloud service since they are heterogeneous ● CRUD operations on VMs requires the development of SDK or vendor specific managements
  • 8. So what does it do? ...in short ● maps local docker cmd to docker command on remote machine ● execute the same commands you could do locally on remote machine ● execute CRUD operations on VMs ● switch between hosts: physical, virtual or cloud seamlessly
  • 10. Install docker-machine on Linux curl -L https://github.com/docker/machine/releases/do wnload/v0.3.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine
  • 11. Install docker-machine on MacOS curl -L https://github.com/docker/machine/releases/do wnload/v0.3.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine
  • 12. Install docker-machine on Windows Go here and download version for your platform: https://docs.docker.com/machine/
  • 13. Hello docker-machine docker-machine create --driver virtualbox dev1 docker-machine ls eval "$(docker-machine env dev1)" docker run busybox echo hello world
  • 14. Hello docker-machine again docker-machine create --driver virtualbox dev2 docker-machine ls eval "$(docker-machine env dev2)" docker run busybox echo hello world
  • 15. So what we have? If you do “docker-machine ps” you will have to different machines with one containers inside.
  • 16. A bit real example docker-machine create --driver virtualbox webapp docker-machine ls eval "$(docker-machine env webapp)" docker run -d -p 80:80 nginx
  • 17. So what is this ---driver? Docker-machine works with VMs and dockers inside it. Since the VMs can be on hosted servers, virtual or cloud, it provides drivers that lets to work with each one the way they require.
  • 18. Diving to docker-machine create --help
  • 19. Yeah it’s very long docker-machine create --help | wc -l gives 157 options!!!
  • 20. Filtering the option by driver docker-machine create -d <driver_name> gives options only for specified driver filtering out unrelated options
  • 21. Example: filter for AWS docker-machine create -d amazonec2
  • 22. Example: filter for AWS docker-machine create -d amazonec2
  • 23. Lab work: Create docker on digitalocean Create VM with running nginx on digitalocean using docker-machine help Access token: <access token>
  • 24. Remove those machines, NOW! docker-machine rm <machine_name> docker-machine ls
  • 25. What about connecting to physical servers? To connect to local physical or virtual servers there are two ways: 1) by creating driverless VM 2) by creating using generic driver For the first option there needs to be takes additional steps where you need to create CA certificates using OpenSSL by following article written here https://docs.docker.com/articles/https/ For the second option what is required is to put your public keys on physical or virtual server
  • 26. Lab work: Create generic VM to connect to server Using docker-machine help create vm with generic driver Host IP: 192.168.10.112
  • 27. What about docker remote? export DOCKER_HOST=tcp://<remote_id>:<port> docker run -d -p 80:80 nginx
  • 28. Quiz What is the difference between docker and docker- machine? 1) no difference. docker has remote api 2) docker is the client of docker-machine 3) docker-machine organizes vm and manages dockers inside 4) docker-machine is the manager of cloud vm for dockers
  • 29. Quiz What is the difference between docker and docker- machine? 1) no difference. docker has remote api 2) docker is the client of docker-machine 3) docker-machine organizes vm and manages dockers inside 4) docker-machine is the manager of cloud vm for dockers
  • 30. Quiz Describe the ways of creating docker VMs to connect to host machines.
  • 31. Quiz How many dockers can I create inside VM created by docker-machine?
  • 32. Quiz What is the difference between VM created with --generic driver and --virtualbox driver? 1. No difference. Difference only in driver names 2. IPs are different 3. After creating generic requires SSH access, whereas virtualbox SSH access is generated by docker-machine 4. When you remove virtualbox VM it removes all the data files, whereas generic removes only vm
  • 33. Quiz What is the difference between VM created with --generic driver and --virtualbox driver? 1. No difference. Difference only in driver names 2. IPs are different 3. After creating generic requires SSH access, whereas virtualbox SSH access is generated by docker-machine 4. When you remove virtualbox VM it removes all the data files, whereas generic removes only vm