Docker - docker-machine

Card Puncher Data Processing

About

Docker Machine is a command line client that lets you

You can use Machine to create Docker hosts:

  • on your local Mac or Windows box,
  • on your company network, in your data center,
  • or on cloud providers like AWS or Digital Ocean.

See docker/machine

You can use Docker Machine to:

  • Install and run Docker on Mac or Windows
  • Provision and manage multiple remote Docker hosts
  • Provision Swarm clusters

Docker Machine uses Boot2Docker to initialise, start, stop and delete the VirtualBox's VM right from the command line.

Docker Machine Virtualbox

Management

List your machines.

$ docker-machine ls
  • On my machine
NAME      ACTIVE   DRIVER       STATE     URL   SWARM   DOCKER   ERRORS
default            virtualbox   Timeout

  • From the doc:
NAME                ACTIVE   DRIVER       STATE     URL                        SWARM
dev                 *        virtualbox   Running   tcp://192.168.99.100:2376
my-docker-machine            virtualbox   Stopped
default                      virtualbox   Stopped

Important: If you are using Docker for Mac or Docker for Windows, you can skip this step.

Create your machine

If you are using Docker for Mac or Docker for Windows, you can skip this step.

Example:

docker-machine create \
    --driver virtualbox \
    --virtualbox-memory 8192 \
    --virtualbox-disk-size "40960"  \
    default

Modify the configuration

docker-machine stop
VBoxManage modifyvm default --cpus 2
VBoxManage modifyvm default --memory 8192
docker-machine start

Ssh

docker-machine ssh
##         .                                                     
                  ## ## ##        ==                                                     
               ## ## ## ## ##    ===                                                     
           /"""""""""""""""""\___/ ===                                                   
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~                                            
           \______ o           __/                                                       
             \    \         __/                                                          
              \____\_______/                                                             
 _                 _   ____     _            _                                           
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __                               
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|                              
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |                                 
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|                                 
Boot2Docker version 1.12.3, build HEAD : 7fc7575 - Thu Oct 27 17:23:17 UTC 2016          
Docker version 1.12.3, build 6b644ec                                                     
docker@default:~$ exit                                                                   

Remove machine

$ docker-machine rm my-docker-machine
Successfully removed my-docker-machine

Environment

Docker - Host Environment ( OS )

docker-machine env default

# In cmder, see it as cmd but you can ask the output format with the shell argument
docker-machine env default -shell bash

Output:

SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://192.168.99.100:2376
SET DOCKER_CERT_PATH=C:\Users\gerard\.docker\machine\machines\default
SET DOCKER_MACHINE_NAME=default
REM Run this command to configure your shell:
REM     @FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i

IP

docker-machine ip
192.168.99.100

Metadata Location

On Windows, all the metadata (disk, config) are stored at:

C:\Users\user\.docker\machine\machines\machineName
# Example
C:\Users\gerard\.docker\machine\machines\default

Documentation / Reference





Discover More
Docker Host Virtualbox
Docker - (Virtual) Host (or Machine or Server) - Docker Type

a machine where docker server run or a network An host (or machine) is: a virtual host that you can see running in your virtual machine provider (such as virtual box). is managed through the...
Architecture
Docker - Architecture

The docker architecture is composed of: an host where the daemon run a daemon that manage and run all Docker object (such as image and container) a registry to download and push image a docker...
Card Puncher Data Processing
Docker - Boot2Docker

boot2docker/boot2dockerBoot2Docker is the kernel of the OS linux of the Docker Machine When you ssh in the host with docker-machine, you get the boot2docker prompt. tce-load...
Card Puncher Data Processing
Docker - Host Environment ( OS )

Host environment variable A docker machine must have minimal OS environment value in order to function correctly. Output: The following list of environment variables are supported by the docker...
Docker For Windows Host Settings
Docker - Installation Docker for Windows on Windows 10

In Windows 10, you install docker with Docker for Windows. The installation provides: Docker Engine, Docker CLI client, Docker Compose Docker Machine, and Kitematic. In the settings...
Toolbox Componentns
Docker - Installation for Windows 7 (Docker Toolbox)

How I have installed and configured Docker in my Windows 7 laptop. The software for windows 7 is called Docker Toolbox. Before version Windows 10: Toolbox:...
Card Puncher Data Processing
Docker - Start / Stop

To be able to play with docker: a machine must be started: the environment of the machine must be set: Output: Output:
Card Puncher Data Processing
Docker - Version (Client and Server - Daemon)

Version of the docker Client and Server (Daemon). See also: for OS and other component version. The host version (called the server)
Jenkins Extended Email Notification
Jenkins - Windows Installation

installation of Jenkins Windows Go to the Manage Jenkins page Install it as a service (it will be installed on the port 8080) Change the service argument in this file: C:\Users\gerard\.jenkins\jenkins.xml...
Docker Memory Kafka
Kafka - Docker

Docker usage in Confluent. The docker host must: use virtualbox as provider have a minimal of 6000 as virtual memory In docker machine command line, it means: In virtualbox, you can confirm...



Share this page:
Follow us:
Task Runner