Skip to content

Latest commit

 

History

History

docker-machine

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Docker Machine

CLI

Installation

Homebrew

brew install docker-machine

Linux

sudo curl -L "https://github.com/docker/machine/releases/download/v0.16.1/docker-machine-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-machine && sudo chmod +x /usr/local/bin/docker-machine

Chocolatey

choco install -y docker-machine

Commands

docker-machine -h

Create

Oracle VirtualBox

docker-machine create \
  $(echo $DOCKER_MACHINE_CREATE_OPTS) \
  --virtualbox-cpu-count 2 \
  --virtualbox-disk-size 40000 \
  --virtualbox-hostonly-cidr '10.100.1.1/24' \
  --virtualbox-memory 4096 \
  default
xhyve
docker-machine create \
  $(echo $DOCKER_MACHINE_CREATE_OPTS) \
  -d xhyve \
  --xhyve-cpu-count 2 \
  --xhyve-disk-size 40000 \
  --xhyve-memory-size 4096 \
  default
VMware
docker-machine create \
  $(echo $DOCKER_MACHINE_CREATE_OPTS) \
  -d vmware \
  --vmware-cpu-count 2 \
  --vmware-disk-size 40000 \
  --vmware-memory-size 4096 \
  default
Parallels

Dependency: Docker Machine Driver Parallels

docker-machine create \
  $(echo $DOCKER_MACHINE_CREATE_OPTS) \
  -d parallels \
  --parallels-cpu-count 2 \
  --parallels-disk-size 40000 \
  --parallels-memory 4096 \
  default

Configuration

eval "$(docker-machine env)"

Environment Proxy

jq ".HostOptions.EngineOptions.Env += [ \"http_proxy=$http_proxy\" ]" ~/.docker/machine/machines/$DOCKER_MACHINE_NAME/config.json | sponge ~/.docker/machine/machines/$DOCKER_MACHINE_NAME/config.json

jq ".HostOptions.EngineOptions.Env += [ \"https_proxy=$https_proxy\" ]" ~/.docker/machine/machines/$DOCKER_MACHINE_NAME/config.json | sponge ~/.docker/machine/machines/$DOCKER_MACHINE_NAME/config.json

jq ".HostOptions.EngineOptions.Env += [ \"no_proxy=$no_proxy\" ]" ~/.docker/machine/machines/$DOCKER_MACHINE_NAME/config.json | sponge ~/.docker/machine/machines/$DOCKER_MACHINE_NAME/config.json
docker-machine provision "$DOCKER_MACHINE_NAME"
docker info | grep Proxy

Network

Bridge
jq '.HostOptions.EngineOptions.ArbitraryFlags += [ "bip=10.1.1.1/16" ]' ~/.docker/machine/machines/$DOCKER_MACHINE_NAME/config.json | \
  sponge ~/.docker/machine/machines/$DOCKER_MACHINE_NAME/config.json
docker-machine provision "$DOCKER_MACHINE_NAME"
docker-machine ssh "$DOCKER_MACHINE_NAME" ip addr show docker0

Tips

TODO