github.com/slene/docker@v1.8.0-rc1/docs/installation/windows.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "Installation on Windows"
     4  description = "Docker installation on Microsoft Windows"
     5  keywords = ["Docker, Docker documentation, Windows, requirements, virtualbox,  boot2docker"]
     6  [menu.main]
     7  parent = "smn_engine"
     8  +++
     9  <![end-metadata]-->
    10  
    11  # Windows
    12  > **Note:**
    13  > Docker has been tested on Windows 7 and 8.1; it may also run on older versions.
    14  > Your processor needs to support hardware virtualization.
    15  
    16  The Docker Engine uses Linux-specific kernel features, so to run it on Windows
    17  we need to use a lightweight virtual machine (VM).  You use the **Windows Docker
    18  Client** to control the virtualized Docker Engine to build, run, and manage
    19  Docker containers.
    20  
    21  To make this process easier, we've designed a helper application called
    22  [Boot2Docker](https://github.com/boot2docker/boot2docker) which creates a Linux virtual
    23  machine on Windows to run Docker on a Linux operating system.
    24  
    25  Although you will be using Windows Docker client, the docker engine hosting the
    26  containers will still be running on Linux. Until the Docker engine for Windows
    27  is developed, you can launch only Linux containers from your Windows machine.
    28  
    29  ![Windows Architecture Diagram](/installation/images/win_docker_host.svg)
    30  
    31  ## Demonstration
    32  
    33  <iframe width="640" height="480" src="//www.youtube.com/embed/TjMU3bDX4vo?rel=0" frameborder="0" allowfullscreen></iframe>
    34  
    35  ## Installation
    36  
    37  1. Download the latest release of the
    38     [Docker for Windows Installer](https://github.com/boot2docker/windows-installer/releases/latest).
    39  2. Run the installer, which will install Docker Client for Windows, VirtualBox,
    40     Git for Windows (MSYS-git), the boot2docker Linux ISO, and the Boot2Docker
    41     management tool.
    42     ![](/installation/images/windows-installer.png)
    43  3. Run the **Boot2Docker Start** shortcut from your Desktop or “Program Files →
    44     Boot2Docker for Windows”.
    45     The Start script will ask you to enter an ssh key passphrase - the simplest
    46     (but least secure) is to just hit [Enter].
    47  
    48  4. The **Boot2Docker Start** will start a unix shell already configured to manage
    49     Docker running inside the virtual machine. Run `docker version` to see
    50     if it is working correctly:
    51  
    52  ![](/installation/images/windows-boot2docker-start.png)
    53  
    54  ## Running Docker
    55  
    56  > **Note:** if you are using a remote Docker daemon, such as Boot2Docker, 
    57  > then _do not_ type the `sudo` before the `docker` commands shown in the
    58  > documentation's examples.
    59  
    60  **Boot2Docker Start** will automatically start a shell with environment variables
    61  correctly set so you can start using Docker right away:
    62  
    63  Let's try the `hello-world` example image. Run
    64  
    65      $ docker run hello-world
    66  
    67  This should download the very small `hello-world` image and print a
    68  `Hello from Docker.` message.
    69  
    70  ## Using Docker from Windows Command Line Prompt (cmd.exe)
    71  
    72  Launch a Windows Command Line Prompt (cmd.exe).
    73  
    74  Boot2Docker command requires `ssh.exe` to be in the PATH, therefore we need to
    75  include `bin` folder of the Git installation (which has ssh.exe) to the `%PATH%`
    76  environment variable by running:
    77  
    78      set PATH=%PATH%;"c:\Program Files (x86)\Git\bin"
    79  
    80  and then we can run the `boot2docker start` command to start the Boot2Docker VM.
    81  (Run `boot2docker init` command if you get an error saying machine does not
    82  exist.) Then copy the instructions for cmd.exe to set the environment variables
    83  to your console window and you are ready to run docker commands such as
    84  `docker ps`:
    85  
    86  ![](/installation/images/windows-boot2docker-cmd.png)
    87  
    88  ## Using Docker from PowerShell
    89  
    90  Launch a PowerShell window, then add `ssh.exe` to your PATH:
    91  
    92      $Env:Path = "${Env:Path};c:\Program Files (x86)\Git\bin"
    93  
    94  and after running the `boot2docker start` command it will print PowerShell
    95  commands to set the environment variables to connect to the Docker daemon
    96  running inside the VM. Run these commands and you are ready to run docker
    97  commands such as `docker ps`:
    98  
    99  ![](/installation/images/windows-boot2docker-powershell.png)
   100  
   101  > NOTE: You can alternatively run `boot2docker shellinit | Invoke-Expression`
   102  > command to set the environment variables instead of copying and pasting on
   103  > PowerShell.
   104  
   105  # Further Details
   106  
   107  The Boot2Docker management tool provides several commands:
   108  
   109      $ boot2docker
   110      Usage: boot2docker.exe [<options>] {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|shellinit|delete|download|upgrade|version} [<args>]
   111  
   112  ## Upgrading
   113  
   114  1. Download the latest release of the [Docker for Windows Installer](
   115     https://github.com/boot2docker/windows-installer/releases/latest)
   116  
   117  2. Run the installer, which will update the Boot2Docker management tool.
   118  
   119  3. To upgrade your existing virtual machine, open a terminal and run:
   120  
   121          boot2docker stop
   122          boot2docker download
   123          boot2docker start
   124  
   125  ## Container port redirection
   126  
   127  If you are curious, the username for the boot2docker default user is `docker`
   128  and the password is `tcuser`.
   129  
   130  The latest version of `boot2docker` sets up a host only network adaptor which
   131  provides access to the container's ports.
   132  
   133  If you run a container with an exposed port:
   134  
   135      docker run --rm -i -t -p 80:80 nginx
   136  
   137  Then you should be able to access that nginx server using the IP address reported
   138  to you using:
   139  
   140      boot2docker ip
   141  
   142  Typically, it is 192.168.59.103, but it could get changed by VirtualBox's DHCP
   143  implementation.
   144  
   145  For further information or to report issues, please see the [Boot2Docker site](http://boot2docker.io)
   146  
   147  ## Login with PUTTY instead of using the CMD
   148  
   149  Boot2Docker generates and uses the public/private key pair in your `%USERPROFILE%\.ssh`
   150  directory so to log in you need to use the private key from this same directory.
   151  
   152  The private key needs to be converted into the format PuTTY uses.
   153  
   154  You can do this with
   155  [puttygen](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html):
   156  
   157  - Open `puttygen.exe` and load ("File"->"Load" menu) the private key from
   158    `%USERPROFILE%\.ssh\id_boot2docker`
   159  - then click: "Save Private Key".
   160  - Then use the saved file to login with PuTTY using `docker@127.0.0.1:2022`.
   161  
   162  ## Uninstallation
   163  
   164  You can uninstall Boot2Docker using Window's standard process for removing programs.
   165  This process does not remove the `docker-install.exe` file. You must delete that file
   166  yourself.
   167  
   168  ## References
   169  
   170  If you have Docker hosts running and if you don't wish to do a 
   171  Boot2Docker installation, you can install the docker.exe using
   172  unofficial Windows package manager Chocolately. For information
   173  on how to do this, see [Docker package on Chocolatey](http://chocolatey.org/packages/docker).