windows.rst 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. :title: Requirements and Installation on Windows
  2. :description: Docker's tutorial to run docker on Windows
  3. :keywords: Docker, Docker documentation, Windows, requirements, virtualbox, vagrant, git, ssh, putty, cygwin
  4. .. _windows:
  5. Installing Docker on Windows
  6. ============================
  7. Docker can run on Windows using a VM like VirtualBox. You then run
  8. Linux within the VM.
  9. Installation
  10. ------------
  11. .. include:: install_header.inc
  12. .. include:: install_unofficial.inc
  13. 1. Install virtualbox from https://www.virtualbox.org - or follow this tutorial__
  14. .. __: http://www.slideshare.net/julienbarbier42/install-virtualbox-on-windows-7
  15. 2. Install vagrant from http://www.vagrantup.com - or follow this tutorial__
  16. .. __: http://www.slideshare.net/julienbarbier42/install-vagrant-on-windows-7
  17. 3. Install git with ssh from http://git-scm.com/downloads - or follow this tutorial__
  18. .. __: http://www.slideshare.net/julienbarbier42/install-git-with-ssh-on-windows-7
  19. We recommend having at least 2Gb of free disk space and 2Gb of RAM (or more).
  20. Opening a command prompt
  21. ------------------------
  22. First open a cmd prompt. Press Windows key and then press “R”
  23. key. This will open the RUN dialog box for you. Type “cmd” and press
  24. Enter. Or you can click on Start, type “cmd” in the “Search programs
  25. and files” field, and click on cmd.exe.
  26. .. image:: images/win/_01.gif
  27. :alt: Git install
  28. :align: center
  29. This should open a cmd prompt window.
  30. .. image:: images/win/_02.gif
  31. :alt: run docker
  32. :align: center
  33. Alternatively, you can also use a Cygwin terminal, or Git Bash (or any
  34. other command line program you are usually using). The next steps
  35. would be the same.
  36. .. _launch_ubuntu:
  37. Launch an Ubuntu virtual server
  38. -------------------------------
  39. Let’s download and run an Ubuntu image with docker binaries already
  40. installed.
  41. .. code-block:: bash
  42. git clone https://github.com/dotcloud/docker.git
  43. cd docker
  44. vagrant up
  45. .. image:: images/win/run_02_.gif
  46. :alt: run docker
  47. :align: center
  48. Congratulations! You are running an Ubuntu server with docker
  49. installed on it. You do not see it though, because it is running in
  50. the background.
  51. Log onto your Ubuntu server
  52. ---------------------------
  53. Let’s log into your Ubuntu server now. To do so you have two choices:
  54. - Use Vagrant on Windows command prompt OR
  55. - Use SSH
  56. Using Vagrant on Windows Command Prompt
  57. ```````````````````````````````````````
  58. Run the following command
  59. .. code-block:: bash
  60. vagrant ssh
  61. You may see an error message starting with “`ssh` executable not
  62. found”. In this case it means that you do not have SSH in your
  63. PATH. If you do not have SSH in your PATH you can set it up with the
  64. “set” command. For instance, if your ssh.exe is in the folder named
  65. “C:\Program Files (x86)\Git\bin”, then you can run the following
  66. command:
  67. .. code-block:: bash
  68. set PATH=%PATH%;C:\Program Files (x86)\Git\bin
  69. .. image:: images/win/run_03.gif
  70. :alt: run docker
  71. :align: center
  72. Using SSH
  73. `````````
  74. First step is to get the IP and port of your Ubuntu server. Simply run:
  75. .. code-block:: bash
  76. vagrant ssh-config
  77. You should see an output with HostName and Port information. In this
  78. example, HostName is 127.0.0.1 and port is 2222. And the User is
  79. “vagrant”. The password is not shown, but it is also “vagrant”.
  80. .. image:: images/win/ssh-config.gif
  81. :alt: run docker
  82. :align: center
  83. You can now use this information for connecting via SSH to your
  84. server. To do so you can:
  85. - Use putty.exe OR
  86. - Use SSH from a terminal
  87. Use putty.exe
  88. '''''''''''''
  89. You can download putty.exe from this page
  90. http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Launch
  91. putty.exe and simply enter the information you got from last step.
  92. .. image:: images/win/putty.gif
  93. :alt: run docker
  94. :align: center
  95. Open, and enter user = vagrant and password = vagrant.
  96. .. image:: images/win/putty_2.gif
  97. :alt: run docker
  98. :align: center
  99. SSH from a terminal
  100. '''''''''''''''''''
  101. You can also run this command on your favorite terminal (windows
  102. prompt, cygwin, git-bash, …). Make sure to adapt the IP and port from
  103. what you got from the vagrant ssh-config command.
  104. .. code-block:: bash
  105. ssh vagrant@127.0.0.1 –p 2222
  106. Enter user = vagrant and password = vagrant.
  107. .. image:: images/win/cygwin.gif
  108. :alt: run docker
  109. :align: center
  110. Congratulations, you are now logged onto your Ubuntu Server, running
  111. on top of your Windows machine !
  112. Running Docker
  113. --------------
  114. First you have to be root in order to run docker. Simply run the
  115. following command:
  116. .. code-block:: bash
  117. sudo su
  118. You are now ready for the docker’s “hello world” example. Run
  119. .. code-block:: bash
  120. docker run busybox echo hello world
  121. .. image:: images/win/run_04.gif
  122. :alt: run docker
  123. :align: center
  124. All done!
  125. Now you can continue with the :ref:`hello_world` example.
  126. Troubleshooting
  127. ---------------
  128. VM does not boot
  129. ````````````````
  130. .. image:: images/win/ts_go_bios.JPG
  131. If you run into this error message "The VM failed to remain in the
  132. 'running' state while attempting to boot", please check that your
  133. computer has virtualization technology available and activated by
  134. going to the BIOS. Here's an example for an HP computer (System
  135. configuration / Device configuration)
  136. .. image:: images/win/hp_bios_vm.JPG
  137. On some machines the BIOS menu can only be accessed before startup.
  138. To access BIOS in this scenario you should restart your computer and
  139. press ESC/Enter when prompted to access the boot and BIOS controls. Typically
  140. the option to allow virtualization is contained within the BIOS/Security menu.
  141. Docker is not installed
  142. ```````````````````````
  143. .. image:: images/win/ts_no_docker.JPG
  144. If you run into this error message "The program 'docker' is currently
  145. not installed", try deleting the docker folder and restart from
  146. :ref:`launch_ubuntu`