Dummies Notes – Get Started with Docker Hello World

0
This article represents instructions to get started with Docker on Windows. For detailed documentation on Docker, access the Dockers Help page. For detailed instructions on installation of boot2docker, refer following page. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos.
Following are the key points described later in this article:

  • What is Boot2Docker?
  • Download & Install Boot2Docker
  • Docker Hello World
  • Configure Putty Environment

 

What is Boot2Docker?

Docker Engine uses Linux-specific kernel features. Thus, to run docker engine on Windows, Boot2Docker application is developed. This application creates a Linux virtual machine on Windows to run Docker on a Linux operating system. In order to

Download & Install Boot2Docker

Download the latest release of Boot2Docker from this download page. Once downloaded, run the installer. Following gets installed:

  • VirtualBox
  • Boot2Docker Linux ISO
  • Boot2Docker management tool
  • Docker client for Windows
  • Git for Windows

While installing Boot2Docker, you may come across following message:

Error Message as below:

initializing…
Virtual machine boot2docker-vm already exists

starting…
error in run: Failed to start machine “boot2docker-vm” (run again with -v for de
tails)

C:\Program Files\Boot2Docker for Windows>boot2docker start -v
Boot2Docker-cli version: v1.5.0
Git commit: ccd9032
2015/03/24 23:01:12 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
showvminfo boot2docker-vm –machinereadable
2015/03/24 23:01:13 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
guestproperty set boot2docker-vm /VirtualBox/GuestAdd/SharedFolders/MountPrefix
/
2015/03/24 23:01:13 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
guestproperty set boot2docker-vm /VirtualBox/GuestAdd/SharedFolders/MountDir /
2015/03/24 23:01:13 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
sharedfolder add boot2docker-vm –name c/Users –hostpath C:\Users –automount
VBoxManage.exe: error: Shared folder named ‘c/Users’ already exists
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_IN_USE (0x80bb000c), componen
t SessionMachine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: “CreateSharedFolder(Bstr(name).raw(), Bstr(hostp
ath).raw(), fWritable, fAutoMount)” at line 1009 of file VBoxManageMisc.cpp
2015/03/24 23:01:13 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
setextradata boot2docker-vm VBoxInternal2/SharedFoldersEnableSymlinksCreate/c/U
sers 1
2015/03/24 23:01:13 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
startvm boot2docker-vm –type headless
Waiting for VM “boot2docker-vm” to power on…
VBoxManage.exe: error: VT-x is not available. (VERR_VMX_NO_VMX)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component Console, int
erface IConsole
2015/03/24 23:01:15 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
showvminfo boot2docker-vm –machinereadable
error in run: Failed to start machine “boot2docker-vm”: exit status 1
The above error could be handled by updating your bios on your desktop/laptop to allow virtualization. Once the installation is complete, you would find Boot2Docker Start shortcut on your Desktop. Double click on the “Boot2Docker Start” shortcut. It would ask for ssh key paraphrase. For starters, just press enter. And, you are all set.

Take a look at following video for installing Boot2Docker on Windows.

 

Docker Hello World

Double click on “Boot2Docker Start” and it would startup a shell. You could print “docker run hello-world” and you should be all set.

 

Configure Putty Environment

You could install Putty and configure putty to work with Docker. For that purpose, you would have to do following two steps:

  • Configure port forwarding rules in Virtual Box: Double-click Oracle VM Virtualbox. This could be found on your desktop as a result of installation of Boot2Docker. You would see an application windows with boot2dockey-vm in Running Status in the left-pane. Click on Boot2Docker-vm with running status.Click on Settings on top left. This would open a dialog with several options. Click on Network. Then click on “port-Forwarding” button. Once done, set the ssh settings shown in the screenshot below:
    Docker Port Forwarding Rules

    Docker Port Forwarding Rules

  • Double click on Putty. Create an entry for “Docker” as shown below, and save it.
    Docker Entry in Putty Window

    Docker Entry in Putty Window

  • That is it. Every time you need to work with Docker container, open Putty and double-click on “Docker” to open up a shell. If asked for password, enter “tcuser”. if asked for user, enter “docker”.

Hope these instructions would help you get setup with Docker environment on Windows. Those with all time wish to work on Linux and not installing VM, would love Docker for that reason. I have fallen in love with it anyways. 🙂 L

Ajitesh Kumar
Share.

Leave A Reply

Time limit is exhausted. Please reload the CAPTCHA.