All Projects → pecigonzalo → Docker Machine Vmwareworkstation

pecigonzalo / Docker Machine Vmwareworkstation

Licence: apache-2.0
VMWare Workstation driver for Docker Machine https://github.com/docker/machine

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Docker Machine Vmwareworkstation

docker-machine-driver-arubacloud
ArubaCloud Cloud driver for Docker Machine
Stars: ✭ 30 (-91.55%)
Mutual labels:  docker-machine
node-docker-share
Share local folders with a Docker Machine VM
Stars: ✭ 30 (-91.55%)
Mutual labels:  docker-machine
docker-machine-driver-bhyve
Docker Machine driver for Bhyve
Stars: ✭ 27 (-92.39%)
Mutual labels:  docker-machine
docker-machine-driver-yandex
Yandex.Cloud driver for Docker Machine
Stars: ✭ 21 (-94.08%)
Mutual labels:  docker-machine
docker-machine-mac-nfs-mount
Docker machine Mac OS X nfs mount
Stars: ✭ 17 (-95.21%)
Mutual labels:  docker-machine
docker-workshop
Workshop on Docker, Containers and Golang
Stars: ✭ 20 (-94.37%)
Mutual labels:  docker-machine
ethereum-testnet-docker
基于docker的以太坊集群的开发环境
Stars: ✭ 19 (-94.65%)
Mutual labels:  docker-machine
docker-workbench
Provision a Docker Workbench for use with docker-machine and docker-compose
Stars: ✭ 15 (-95.77%)
Mutual labels:  docker-machine
playing-docker-swarm-docker-machine
Scripts to help you to play with Docker Swarm and Docker Machine
Stars: ✭ 19 (-94.65%)
Mutual labels:  docker-machine
data-processing-pipeline
Real-Time Data Processing Pipeline & Visualization with Docker, Spark, Kafka and Cassandra
Stars: ✭ 79 (-77.75%)
Mutual labels:  docker-machine
rig
Outrigger command line tool
Stars: ✭ 13 (-96.34%)
Mutual labels:  docker-machine
jvm-development-environment
A Vagrant controlled software development environment built around IntelliJ IDEA, PyCharm, Docker and Ubuntu.
Stars: ✭ 42 (-88.17%)
Mutual labels:  docker-machine
node-docker-machine
Programmatic API to Docker Machine.
Stars: ✭ 21 (-94.08%)
Mutual labels:  docker-machine
dops
Docker, Docker Machine, Docker Compose, Terraform, Packer, Ansible and kubectl in Docker
Stars: ✭ 23 (-93.52%)
Mutual labels:  docker-machine
docker-windows-azure
Deploy a Windows "Docker-Machine" on Azure
Stars: ✭ 19 (-94.65%)
Mutual labels:  docker-machine
dockness
DNS for Docker machines
Stars: ✭ 34 (-90.42%)
Mutual labels:  docker-machine
terraform-provider-dockermachine
Docker machine provider for Terraform
Stars: ✭ 20 (-94.37%)
Mutual labels:  docker-machine
Docker Machine Driver Hetzner
Docker machine driver for the new hetzner cloud API
Stars: ✭ 308 (-13.24%)
Mutual labels:  docker-machine
mobymac
Automagically install Docker in a VirtualBox VM with super-fast NFS mounts.
Stars: ✭ 79 (-77.75%)
Mutual labels:  docker-machine
hotsub
Command line tool to run batch jobs concurrently with ETL framework on AWS or other cloud computing resources
Stars: ✭ 29 (-91.83%)
Mutual labels:  docker-machine

Docker Machine VMware Workstation Driver

Join the chat at https://gitter.im/pecigonzalo/docker-machine-vmwareworkstation Windows Build Status

This plugin for Docker Machine creates Docker hosts locally on a VMware Workstation.

This is a placeholder and collaboration point to add a VMware workstation driver for Docker Machine. This driver reuses part of the code from the fusion driver bundled with Docker Machine (as both have the same executable) and includes additional code from Packer VMware driver to detect the location of the files on Windows systems.

This is still a work-in-progress (WIP). I'm working to add the functionality listed on the TODO list. Suggestions and contributions are welcome.

TODO

  • drivers/vmwareworkstation/workstation.go: Rework file for vmware workstation
  • add windows support
  • add cmd/machine-driver-vmwareworkstation.go
  • Add Linux/OSX support
  • Add dhcplease file discovery on windows
  • Add tests cases
  • Create makefile
  • Add docs/drivers/vm-workstation.md

Requirements

Installation

The latest version of docker-machine-driver-vmwareworkstation binary is available on the "Releases" page.

Place the executable in the directory containing docker-machine.exe, or else add it to your $PATH.

Installing with Docker Toolbox

  1. Install Docker Toolbox without VirtualBox

    DockerToolbox-.exe /COMPONENTS="Docker,DockerMachine"

  2. Replace contents of C:\Program Files\Docker Toolbox\start.sh with this script.

    #!/bin/bash
    
    export PATH="$PATH:/mnt/c/Program Files (x86)/VMware/VMware Workstation"
    
    trap '[ "$?" -eq 0 ] || read -p "Looks like something went wrong in step ´$STEP´... Press any key to continue..."' EXIT
    
    VM=${DOCKER_MACHINE_NAME-default}
    DOCKER_MACHINE=./docker-machine.exe
    
    BLUE='\033[1;34m'
    GREEN='\033[0;32m'
    NC='\033[0m'
    
    
    if [ ! -f "${DOCKER_MACHINE}" ]; then
      echo "Docker Machine is not installed. Please re-run the Toolbox Installer and try again."
      exit 1
    fi
    
    vmrun.exe list | grep \""${VM}"\" &> /dev/null
    VM_EXISTS_CODE=$?
    
    set -e
    
    STEP="Checking if machine $VM exists"
    if [ $VM_EXISTS_CODE -eq 1 ]; then
      "${DOCKER_MACHINE}" rm -f "${VM}" &> /dev/null || :
      rm -rf ~/.docker/machine/machines/"${VM}"
      #set proxy variables if they exists
      if [ -n ${HTTP_PROXY+x} ]; then
        PROXY_ENV="$PROXY_ENV --engine-env HTTP_PROXY=$HTTP_PROXY"
      fi
      if [ -n ${HTTPS_PROXY+x} ]; then
        PROXY_ENV="$PROXY_ENV --engine-env HTTPS_PROXY=$HTTPS_PROXY"
      fi
      if [ -n ${NO_PROXY+x} ]; then
        PROXY_ENV="$PROXY_ENV --engine-env NO_PROXY=$NO_PROXY"
      fi  
      "${DOCKER_MACHINE}" create -d vmwareworkstation $PROXY_ENV "${VM}"
    fi
    
    STEP="Checking status on $VM"
    VM_STATUS="$(${DOCKER_MACHINE} status ${VM} 2>&1)"
    if [ "${VM_STATUS}" != "Running" ]; then
      "${DOCKER_MACHINE}" start "${VM}"
      yes | "${DOCKER_MACHINE}" regenerate-certs "${VM}"
    fi
    
    STEP="Setting env"
    eval "$(${DOCKER_MACHINE} env --shell=bash ${VM})"
    
    STEP="Finalize"
    clear
    cat << EOF
    
    
                            ##         .
                      ## ## ##        ==
                   ## ## ## ## ##    ===
               /"""""""""""""""""\___/ ===
          ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
               \______ o           __/
                 \    \         __/
                  \____\_______/
    
    EOF
    echo -e "${BLUE}docker${NC} is configured to use the ${GREEN}${VM}${NC} machine with IP ${GREEN}$(${DOCKER_MACHINE} ip ${VM})${NC}"
    echo "For help getting started, check out the docs at https://docs.docker.com"
    echo
    cd
    
    docker () {
      MSYS_NO_PATHCONV=1 docker.exe "[email protected]"
    }
    export -f docker
    
    if [ $# -eq 0 ]; then
      echo "Start interactive shell"
      exec "$BASH" --login -i
    else
      echo "Start shell with command"
      exec "$BASH" -c "$*"
    fi
    

    Credit for the above script to @gtirloni

Usage

Official documentation for Docker Machine is available here.

To create a VMware Workstation based Docker machine, just run this command:

$ docker-machine create --driver=vmwareworkstation dev

Options

  • --vmwareworkstation-boot2docker-url: The URL of the Boot2Docker image.
  • --vmwareworkstation-disk-size: Size of disk for the host VM (in MB).
  • --vmwareworkstation-memory-size: Size of memory for the host VM (in MB).
  • --vmwareworkstation-cpu-count: Number of CPUs to use to create the VM (-1 to use the number of CPUs available).
  • --vmwareworkstation-ssh-user: SSH user
  • --vmwareworkstation-ssh-password: SSH password
  • --vmwareworkstation-no-share: Disable the mount of your home directory
  • --vmwareworkstation-share-folder: Mount the specified directory instead of the default home location. Format: name:dir
  • --vmwareworkstation-guest-share-link: Additional link to the shared mount in the guest

The --vmwareworkstation-boot2docker-url flag takes a few different forms. By default, if no value is specified for this flag, Machine checks locally for a Boot2Docker ISO. If one is found, that will be used as the ISO for the new machine. If one is not found, the latest ISO release available on boot2docker/boot2docker will be downloaded and stored locally for future use. Note that this means you must run docker-machine upgrade deliberately on a machine if you wish to update the "cached" Boot2Docker ISO.

This is the default behavior (when --vmwareworkstation-boot2docker-url=""), but the option also supports specifying ISOs by the http:// and file:// protocols.

Environment variables and default values:

CLI option Environment variable Default
--vmwareworkstation-boot2docker-url WORKSTATION_BOOT2DOCKER_URL Latest boot2docker url
--vmwareworkstation-cpu-count WORKSTATION_CPU_COUNT 1
--vmwareworkstation-disk-size WORKSTATION_DISK_SIZE 20000
--vmwareworkstation-memory-size WORKSTATION_MEMORY_SIZE 1024
--vmwareworkstation-ssh-user WORKSTATION_SSH_USER docker
--vmwareworkstation-ssh-password WORKSTATION_SSH_PASSWORD tcuser
--vmwareworkstation-no-share WORKSTATION_NO_SHARE false
--vmwareworkstation-share-folder WORKSTATION_SHARE_FOLDER Linux: /home Windows: C:\Users\
--vmwareworkstation-share-compat WORKSTATION_SHARE_COMPAT Windows: /c/Users

Development

Build from Source

If you wish to work on VMware Workstation Driver for Docker machine, you'll first need:

  • Go installed (version 1.6+ is required).

    • Make sure Go is properly installed, including setting up a GOPATH.
  • MSYS

    • Make We well need to use pacman to install make
  • Currently, the build only works on Windows (WIP to get it to work on other platforms)

To build the plugin executable binary, run these commands:

$ go get -d github.com/pecigonzalo/docker-machine-vmwareworkstation
$ cd $GOPATH/github.com/pecigonzalo/docker-machine-vmwareworkstation
$ make

The build creates the binary as bin/docker-machine-driver-vmwareworkstation. If you want, copy it to ${GOPATH}/bin/.

Authors

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].