Skip to content

Files

Latest commit

 

History

History
486 lines (336 loc) · 27.1 KB

File metadata and controls

486 lines (336 loc) · 27.1 KB
description keywords redirect_from title
Getting Started
windows, beta, alpha, tutorial
/winkit/getting-started/
/winkit/
/windows/
/windows/started/
/docker-for-windows/started/
/installation/windows/
Get started with Docker for Windows

Welcome to Docker for Windows!

Please read through these topics on how to get started. To give us your feedback on your experience with the app and report bugs or problems, log in to our Docker for Windows forum.

Already have Docker for Windows? If you already have Docker for Windows installed, and are ready to get started, skip over to the Getting Started with Docker tutorial.

Download Docker for Windows

If you have not already done so, please install Docker for Windows. You can download installers from the stable or beta channel. For more about stable and beta channels, see the FAQs.

Stable channel Beta channel
This installer is fully baked and tested, and comes with the latest GA version of Docker Engine.

This is the best channel to use if you want a reliable platform to work with.

These releases follow a version schedule with a longer lead time than the betas, synched with Docker Engine releases and hotfixes.
This installer offers cutting edge features and comes with the experimental version of Docker Engine, which is described in the Docker Experimental Features README on GitHub.

This is the best channel to use if you want to experiment with features we are working on as they become available, and can weather some instability and bugs. This channel is a continuation of the beta program, where you can provide feedback as the apps evolve. Releases are typically more frequent than for stable, often one or more per month.
Get Docker for Windows (stable)

Download checksum: InstallDocker.msi SHA256
Get Docker for Windows (beta)

Download checksum: InstallDocker.msi SHA256

Important Notes:

  • Docker for Windows requires 64bit Windows 10 Pro, Enterprise and Education (1511 November update, Build 10586 or later) and Microsoft Hyper-V. Please see What to know before you install for a full list of prerequisites.

  • You can switch between beta and stable versions, but you must have only one app installed at a time. Also, you will need to save images and export containers you want to keep before uninstalling the current version before installing another. For more about this, see the FAQs about beta and stable channels.

What to know before you install

  • README FIRST for Docker Toolbox and Docker Machine users: Docker for Windows requires Microsoft Hyper-V to run. After Hyper-V is enabled, VirtualBox will no longer work, but any VirtualBox VM images will remain. VirtualBox VMs created with docker-machine (including the default one typically created during Toolbox install) will no longer start. These VMs cannot be used side-by-side with Docker for Windows. However, you can still use docker-machine to manage remote VMs.

* The current version of Docker for Windows runs on 64bit Windows 10 Pro, Enterprise and Education (1511 November update, Build 10586 or later). In the future we will support more versions of Windows 10.

* Containers and images created with Docker for Windows are shared between all user accounts on machines where it is installed. This is because all Windows accounts will use the same VM to build and run containers. In the future, Docker for Windows will better isolate user content.

* The Hyper-V package must be enabled for Docker for Windows to work. The Docker for Windows installer will enable it for you, if needed. (This requires a reboot). If your system does not satisfy these requirements, you can install [Docker Toolbox](/toolbox/overview.md), which uses Oracle Virtual Box instead of Hyper-V.

* Virtualization must be enabled. Typically, virtualization is enabled by default. (Note that this is different from having Hyper-V enabled.) For more detail see [Virtualization must be enabled](troubleshoot.md#virtualization-must-be-enabled) in Troubleshooting.

* **What the Docker for Windows install includes**: The installation provides [Docker Engine](https://docs.docker.com/engine/userguide/intro/), Docker CLI client, [Docker Compose](https://docs.docker.com/compose/overview/), and [Docker Machine](https://docs.docker.com/machine/overview/).

About Windows containers and Windows Server 2016

Looking for information on using Windows containers?

  • Getting Started with Windows Containers (Lab) provides a tutorial on how to set up and run Windows containers on Windows 10 or with Windows Server 2016. It shows you how to use a MusicStore application with Windows containers.

* [Setup - Windows Server 2016 (Lab)](https://github.com/docker/labs/blob/master/windows/windows-containers/Setup-Server2016.md) specifically describes environment setup.

* [Switch between Windows and Linux containers (Beta feature)](index.md#switch-between-windows-and-linux-containers-beta-feature) describes the Linux / Windows containers toggle in Docker for Windows and points you to the tutorial mentioned above.

* Docker Container Platform for Windows Server 2016 [articles and blog posts](https://www.docker.com/microsoft) on the Docker website

Step 1. Install Docker for Windows

  1. Double-click InstallDocker.msi to run the installer.

    If you haven't already downloaded the installer (InstallDocker.msi), you can get it here. It typically downloads to your Downloads folder, or you can run it from the recent downloads bar at the bottom of your web browser.

  2. Follow the install wizard to accept the license, authorize the installer, and proceed with the install.

    You will be asked to authorize Docker.app with your system password during the install process. Privileged access is needed to install networking components, links to the Docker apps, and manage the Hyper-V VMs.

  3. Click Finish on the setup complete dialog to launch Docker.

    Install complete>

Step 2. Start Docker for Windows

When the installation finishes, Docker starts automatically.

The whale in the status bar indicates that Docker is running, and accessible from a terminal.

If you just installed the app, you also get a popup success message with suggested next steps, and a link to this documentation.

Install success

When initialization is complete, select About Docker from the notification area icon to verify that you have the latest version.

Congratulations! You are up and running with Docker for Windows.

Step 3. Check versions of Docker Engine, Compose, and Machine

Start your favorite shell (cmd.exe, PowerShell, or other) to check your versions of docker and docker-compose, and verify the installation.

  PS C:\Users\samstevens> docker --version
  Docker version 1.12.0, build 8eab29e, experimental

  PS C:\Users\samstevens> docker-compose --version
  docker-compose version 1.8.0, build d988a55

  PS C:\Users\samstevens> docker-machine --version
  docker-machine version 0.8.0, build b85aac1

Step 4. Explore the application and run examples

The next few steps take you through some examples. These are just suggestions for ways to experiment with Docker on your system, check version information, and make sure docker commands are working properly.

  1. Open a shell (cmd.exe, PowerShell, or other).

  2. Run some Docker commands, such as docker ps, docker version, and docker info.

    Here is the output of docker ps run in a powershell. (In this example, no containers are running yet.)

       PS C:\Users\samstevens> docker ps
       CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    

    Here is an example of command output for docker version.

       PS C:\Users\Vicky> docker version
       Client:
       Version:      1.12.0
       API version:  1.24
       Go version:   go1.6.3
       Git commit:   8eab29e
       Built:        Thu Jul 28 21:04:48 2016
       OS/Arch:      windows/amd64
       Experimental: true
    
       Server:
       Version:      1.12.0
       API version:  1.24
       Go version:   go1.6.3
       Git commit:   8eab29e
       Built:        Thu Jul 28 21:04:48 2016
       OS/Arch:      linux/amd64
       Experimental: true
    

    Here is an example of command output for docker info.

       PS C:\Users\Vicky> docker info
       Containers: 0
       Running: 0
       Paused: 0
       Stopped: 0
       Images: 0
       Server Version: 1.12.0
       Storage Driver: aufs
       Root Dir: /var/lib/docker/aufs
       Backing Filesystem: extfs
       Dirs: 0
       Dirperm1 Supported: true
       Logging Driver: json-file
       Cgroup Driver: cgroupfs
       Plugins:
       Volume: local
       Network: host bridge null overlay
       Swarm: inactive
       Runtimes: runc
       Default Runtime: runc
       Security Options: seccomp
       Kernel Version: 4.4.16-moby
       Operating System: Alpine Linux v3.4
       OSType: linux
       Architecture: x86_64
       CPUs: 2
       Total Memory: 1.95 GiB
       Name: moby
       ID: BG6O:2VMH:OLNV:DDLF:SCSV:URRH:BW6M:INBW:OLAC:J7PX:XZVL:ADNB
       Docker Root Dir: /var/lib/docker
       Debug Mode (client): false
       Debug Mode (server): false
       Registry: https://index.docker.io/v1/
       Experimental: true
       Insecure Registries:
       127.0.0.0/8
    

    Note: The outputs above are examples. Your output for commands like docker version and docker info will vary depending on your product versions (e.g., as you install newer versions).

  3. Run docker run hello-world to test pulling an image from Docker Hub and starting a container.

      PS C:\Users\samstevens> docker run hello-world
    
      Hello from Docker.
      This message shows that your installation appears to be working correctly.
    
      To generate this message, Docker took the following steps:
      1. The Docker client contacted the Docker daemon.
      2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
      3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.
      4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
    
  4. Try something more ambitious, and run an Ubuntu container in a Bash shell.

       $ docker run -it ubuntu bash
    
       PS C:\Users\samstevens> docker run -it ubuntu bash
       Unable to find image 'ubuntu:latest' locally
       latest: Pulling from library/ubuntu
       5a132a7e7af1: Pull complete
       fd2731e4c50c: Pull complete
       28a2f68d1120: Pull complete
       a3ed95caeb02: Pull complete
       Digest: sha256:4e85ebe01d056b43955250bbac22bdb8734271122e3c78d21e55ee235fc6802d
       Status: Downloaded newer image for ubuntu:latest
    

    Type exit to stop the container and close the Bash shell.

  5. For the pièce de résistance, start a Dockerized webserver with this command:

       docker run -d -p 80:80 --name webserver nginx
    

    This will download the nginx container image and start it. Here is the output of running this command in a powershell.

       PS C:\Users\samstevens> docker run -d -p 80:80 --name webserver nginx
       Unable to find image 'nginx:latest' locally
       latest: Pulling from library/nginx
    
       fdd5d7827f33: Pull complete
       a3ed95caeb02: Pull complete
       716f7a5f3082: Pull complete
       7b10f03a0309: Pull complete
       Digest: sha256:f6a001272d5d324c4c9f3f183e1b69e9e0ff12debeb7a092730d638c33e0de3e
       Status: Downloaded newer image for nginx:latest
       dfe13c68b3b86f01951af617df02be4897184cbf7a8b4d5caf1c3c5bd3fc267f
    
  6. Point your web browser at http://localhost to display the start page.

    (Since you specified the default HTTP port, it isn't necessary to append :80 at the end of the URL.)

    Run nginx edge>

  7. Run docker ps while your webserver is running to see details on the container.

      PS C:\Users\samstevens> docker ps
      CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS
      NAMES
      dfe13c68b3b8        nginx               "nginx -g 'daemon off"   3 days ago          Up 45 seconds       0.0.0.0:80->80/tcp, 443/tc
      p   webserver
    
  8. Stop or remove containers and images.

    The nginx webserver will continue to run in the container on that port until you stop and/or remove the container. If you want to stop the webserver, type: docker stop webserver and start it again with docker start webserver.

    To stop and remove the running container with a single command, type: docker rm -f webserver. This will remove the container, but not the nginx image. You can list local images with docker images. You might want to keep some images around so that you don't have to pull them again from Docker Hub. To remove an image you no longer need, use docker rmi <imageID>|<imageName>. For example, docker rmi nginx.

Want more example applications? - For more example walkthroughs that include setting up services and databases with Docker Compose, see Example Applications.

Docker Settings

When Docker is running, the Docker whale is displayed in the system tray. If it is hidden, click the up arrow in the tray to show it.

Showing hidden apps in the system tray

To get a popup menu with application options, right-click the whale:

Docker for Windows popup menu

The Settings dialogs provide options to allow Docker auto-start, automatically check for updates, share local drives with Docker containers, enable VPN compatibility, manage CPUs and memory Docker uses, restart Docker, or perform a factory reset.

Beta 26 and newer include an option to switch between Windows and Linux conatiners. See Switch between Windows and Linux containers (Beta feature). This is not yet available on stable builds.

Beta 26 popup with switch for Windows or Linux containers

General

Settings

  • Start Docker when you log in - Automatically start the Docker for Windows application upon Windows system login.

  • Check for updates when the application starts - Docker for Windows is set to automatically check for updates and notify you when an update is available. If an update is found, click OK to accept and install it (or cancel to keep the current version). Uncheck this option if you do not want notifications of version upgrades. You can still find out about updates manually by choosing Check for Updates from the menu.

  • Send usage statistics - You can set Docker for Windows to auto-send diagnostics, crash reports, and usage data. This information can help Docker improve the application and get more context for troubleshooting problems.

    Uncheck any of the options to opt out and prevent auto-send of data. Docker may prompt for more information in some cases, even with auto-send enabled. Also, you can enable or disable these auto-reporting settings with one click on the information popup when you first start Docker.

    Startup information

Shared Drives

Share your local drives (volumes) with Docker for Windows, so that they are available to your containers.

Shared Drives

You will be asked to provide your Windows system username and password (domain user) to apply shared drives. You can select an option to have Docker store the credentials so that you don't have to re-enter them every time.

Permissions to access shared drives are tied to the credentials you provide here. If you run docker commands and tasks under a different username than the one used here to set up sharing, your containers will not have permissions to access the mounted volumes.

Tip: In general, shared drives are only required for volume mounting Linux containers, and not for Windows containers. However, if the project lives outside of the \Users directory, you need to share the drive where the Dockerfile and volume are located even if you are using Windows containers). Runtime errors such as file not found or cannot start service may indicate shared drives are needed. (See also Volume mounting requires shared drives for Linux containers and for any project directories outside of C:\Users.)

See also Verify domain user has permissions for shared drives in Troubleshooting.

Firewall rules for shared drives

Shared drives require port 445 to be open between the host machine and the virtual machine that runs Linux containers.

Note: In Docker for Windows Beta 29 and higher, Docker detects if port 445 is closed and shows the following message when you try to add a shared drive: Port 445 blocked

To share the drive, allow connections between the Windows host machine and the virtual machine in Windows Firewall or your third party firewall software. You do not need to open port 445 on any other network. By default, allow connections to 10.0.75.1 port 445 (the Windows host) from 10.0.75.2 (the virtual machine).

Advanced

CPU and Memory settings

  • CPUs - Change the number of processors assigned to the Linux VM.

  • Memory - Change the amount of memory the Docker for Windows Linux VM uses.

Please note, updating these settings requires a reconfiguration and reboot of the Linux VM. This will take a few seconds.

Network

You can configure Docker for Windows networking to work on a virtual private network (VPN).

  • Internal Virtual Switch - You can specify a network address translation (NAT) prefix and subnet mask to enable internet connectivity.

  • DNS Server - You can configure the DNS server to use dynamic or static IP addressing.

Network settings

Note: Some users reported problems connecting to Docker Hub on Docker for Windows stable version. This would manifest as an error when trying to run docker commands that pull images from Docker Hub that are not already downloaded, such as a first time run of docker run hello-world. If you encounter this, reset the DNS server to use the Google DNS fixed address: 8.8.8.8. For more information, see Networking issues in Troubleshooting.

Note that updating these settings requires a reconfiguration and reboot of the Linux VM.

Proxies

Docker for Windows lets you configure HTTP/HTTPS Proxy Settings and automatically propagate these to Docker and to your containers. For example, if you set your proxy settings to http://proxy.example.com, Docker will use this proxy when pulling containers.

Proxies

When you start a container, you will see that your proxy settings propagate into the containers. For example:

$ docker run -it alpine env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=b7edf988b2b5
TERM=xterm
HOME=/root
HTTP_PROXY=http://proxy.example.com:3128
http_proxy=http://proxy.example.com:3128
no_proxy=*.local, 169.254/16

You can see from the above output that the HTTP_PROXY, http_proxy and no_proxy environment variables are set. When your proxy configuration changes, Docker restarts automatically to pick up the new settings. If you have containers that you wish to keep running across restarts, you should consider using restart policies

Docker daemon

You can configure options on the Docker daemon in the given JSON configuration file, and determine how your containers will run.

For a full list of options on the Docker daemon, see daemon in the Docker Engine command line reference.

Docker Daemon

Note that updating these settings requires a reconfiguration and reboot of the Linux VM.

Switch between Windows and Linux containers (Beta feature)

Starting with Beta 26, you can select which daemon (Linux or Windows) the Docker CLI talks to. Select Switch to Windows containers to toggle to Windows containers. Select Switch to Linux containers.

Microsoft Developer Network has preliminary/draft information on Windows containers here.

This feature is not yet available on stable builds.

See also Shared Drives

Getting started with Windows containers (Beta feature)

If you are interested in working with Windows containers, here are some guides to help you get started.

Diagnose and Feedback

If you encounter problems for which you do not find solutions in this documentation, searching Docker for Windows issues on GitHub already filed by other users, or on the Docker for Windows forum, we can help you troubleshoot the log data.

Select Upload a diagnostic.

This uploads (sends) the logs to Docker.

Diagnose problems and Feedback

To create a new issue directly on GitHub, open Docker for Windows issues on GitHub in your web browser and follow the instructions in the README. Click New Issue on that page to get a "create new issue" template prepopulated with sections for the ID and summary of your diagnostics, system and version details, description of expected and actual behavior, and steps to reproduce the issue.

issue template

Reset

Reset

  • Restart Docker - Shuts down and restarts the Docker application.

  • Reset to Toolbox default machine content - Imports containers and images from the existing Docker Toolbox machine named default. (This option is enabled only if you have Toolbox installed.) The VirtualBox VM will not be removed.

  • Reset to factory defaults - Resets Docker to factory defaults. This is useful in cases where Docker stops working or becomes unresponsive.

Where to go next

  • Try out the Getting Started with Docker tutorial.

  • Dig in deeper with learn by example tutorials on building images, running containers, networking, managing data, and storing images on Docker Hub.

  • See Example Applications for example applications that include setting up services and databases in Docker Compose.

  • Interested in trying out the new swarm mode on Docker Engine v1.12?

    See Get started with swarm mode, a tutorial which includes specifics on how to leverage your Docker for Windows installation to run single and multi-node swarms.

    Also, try out the Swarm examples in docker labs. Run the bash script and follow the accompanying Docker Swarm Tutorial. The script uses Docker Machine to create a multi-node swarm, then walks you through various Swarm tasks and commands.

  • For a summary of Docker command line interface (CLI) commands, see Docker CLI Reference Guide.

  • Check out the blog posts on Docker for Mac and Docker for Windows public betas, and earlier posts on the initial private beta.

  • Please give feedback on your experience with the app and report bugs and problems by logging into our Docker for Windows forum.