Skip to content

Instantly share code, notes, and snippets.

@jakirkham
Last active November 28, 2019 00:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakirkham/252b4c9a268d1ee24a33 to your computer and use it in GitHub Desktop.
Save jakirkham/252b4c9a268d1ee24a33 to your computer and use it in GitHub Desktop.
Boot2Docker_for_Windows

Install and setup Boot2Docker.

  1. Boot2Docker download form web page
  2. Use icon placed on screen
  3. boot2docker ssh
  4. docker login ( Use Docker Hub credentials username, pass, and email )

Add VirtualBox to your path

  1. Go to the Start Menu and select Control Panel.
  2. Click the search box and type "environment variables" (you may not need to type the whole thing to get the right item).
  3. Select "Edit the system environment variables".
  4. In the list below "User variables for ", one will say "Path", double click on it.
  5. Append this to the existing value ";C:\Program Files\Oracle\VirtualBox".
  6. Ok, the way out. Now we have access to the docker and VirtualBox executables.
  7. Close and reopen "Boot2Docker Start".

Port Forwarding

  • Should now be the same as we have added VirtualBox stuff to the path.
  • VBoxManage controlvm "boot2docker-vm" natpf1 "ipython-port,tcp,,8888,,8888"

Mounting folders

  • On Windows, when inside the VM, Boot2Docker has already mapped all folders to not use backslashes. So, they appear a little different. Below we walk through an example.
  1. If you aren't in the VM already, run boot2docker ssh
  2. Let's map a volume into docker. Suppose we have this path C:\Users\kirkhamj\Saved Games. It becomes this /c/Users/kirkhamj/Saved\ Games/. What happened?
    • C: -> /c
    • \ -> /
    • Finally, spaces are escaped (e.g. -> \ ). The backslash character is used like this in a number of cases (e.g. parentheses, quotes*, etc.). Also, backslashes escape themselves \ -> \\.
    • If you aren't sure with a path, just tab complete it. If there is more than one option, it will list them.

Refs

  1. https://docs.docker.com/installation/windows
  2. http://blog.tutum.co/2014/11/05/how-to-use-docker-on-windows
  3. https://github.com/boot2docker/boot2docker/blob/master/doc/WORKAROUNDS.md
  4. http://serverfault.com/questions/365423/how-to-run-vboxmanage-exe
  5. http://stackoverflow.com/questions/29788897/boot2docker-mount-host-volume-to-externalize-data-using-windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment