Tags

,

If you are running with Windows with git bash:

## change to root directory
$ cd ~  
$ if [[ ! -d "$HOME/bin" ]]; then mkdir -p "$HOME/bin"; fi && \
curl -L https://github.com/docker/machine/releases/download/v0.12.2/docker-machine-Windows-x86_64.exe > "$HOME/bin/docker-machine.exe" && \
chmod +x "$HOME/bin/docker-machine.exe"

Test the docker machine if it works

$ docker-machine --version
docker-machine.exe version 0.12.2, build 9371605

If it is working then let’s create our first docker machine name ‘dev’

$ docker-machine create --driver virtualbox dev
Creating CA: C:\Users\hax0r\.docker\machine\certs\ca.pem
Creating client certificate: C:\Users\hax0r\.docker\machine\certs\cert.pem
Running pre-create checks...
(dev) You are using version 4.3.28r100309 of VirtualBox. If you encounter issues, you might want to upgrade to version 5 at https://www.virtualbox.org
(dev) Image cache directory does not exist, creating it at C:\Users\hax0r\.docker\machine\cache...
(dev) No default Boot2Docker ISO found locally, downloading the latest release...
(dev) Latest release for github.com/boot2docker/boot2docker is v17.06.0-ce
(dev) Downloading C:\Users\hax0r\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v17.06.0-ce/boot2docker.iso...
(dev) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(dev) Copying C:\Users\hax0r\.docker\machine\cache\boot2docker.iso to C:\Users\hax0r\.docker\machine\machines\dev\boot2docker.iso...
(dev) Creating VirtualBox VM...
(dev) Creating SSH key...
(dev) Starting the VM...
(dev) Check network to re-create if needed...
(dev) Windows might ask for the permission to create a network adapter. Sometimes, such confirmation window is minimized in the taskbar.
(dev) Found a new host-only adapter: "VirtualBox Host-Only Ethernet Adapter #3"
(dev) Windows might ask for the permission to configure a network adapter. Sometimes, such confirmation window is minimized in the taskbar.
(dev) Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.
(dev) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: C:\Users\hax0r\bin\docker-machine.exe env dev

Next, login into a machine with ssh

$ docker-machine ssh
Advertisements