打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Getting Started

Advisory: Docker for Windows is currently in public beta. Some functionality may change before the product becomes generally available.

Getting Started with Docker for Windows?

Welcome to the Docker for Windows Beta program! Thank you for trying it out.

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 done so already, please download Docker for Windows.

Get Docker for Windows

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.

  • You can import a default VirtualBox VM after installing Docker for Windows by using the Settings menu in the System Tray.

  • 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).

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 and links to the Docker apps.

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

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.

On every start of Docker, you will be prompted by Windows for privileged access. This allows Docker to manage Hyper-V VMs.

  1. On the first start of Docker, provide the token you received in the Beta invitation email.

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

Congratulations! You’re up and running with Docker for Windows.

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

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

  PS C:\Users\samstevens> docker --version  Docker version 1.12.0-rc2, build 906eacd, experimental  PS C:\Users\samstevens> docker-compose --version  docker-compose version 1.8.0-rc1, build 9bf6bc6  PS C:\Users\samstevens> docker-machine --version  docker-machine.exe version 0.8.0-rc1, build fffa6c9

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 (either cmd.exe or PowerShell)

  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\samstevens> docker version  Client:  Version:      1.12.0-rc2  API version:  1.24  Go version:   go1.6.2  Git commit:   906eacd  Built:        Fri Jun 17 20:35:33 2016  OS/Arch:      windows/amd64  Experimental: true  Server:  Version:      1.12.0-rc2  API version:  1.24  Go version:   go1.6.2  Git commit:   a7119de  Built:        Fri Jun 17 22:09:20 2016  OS/Arch:      linux/amd64  Experimental: true

    Here is an example of command output for docker info.

      PS C:\Users\samstevens> docker info  Containers: 2  Running: 0  Paused: 0  Stopped: 2  Images: 25  Server Version: 1.12.0-rc2  Storage Driver: aufs  Root Dir: /var/lib/docker/aufs  Backing Filesystem: extfs  Dirs: 99  Dirperm1 Supported: true  Logging Driver: json-file  Cgroup Driver: cgroupfs  Plugins:  Volume: local  Network: bridge overlay host null  Swarm: inactive  Runtimes: default  Default Runtime: default  Security Options: seccomp  Kernel Version: 4.4.13-moby  Operating System: Alpine Linux v3.4  OSType: linux  Architecture: x86_64  CPUs: 2  Total Memory: 1.951 GiB  Name: moby  ID: JCX2:ZNKL:FNKB:JGJG:STFX:FJG4:X3KR:GGLU:V4JZ:JQQH:AWHI:F3IJ  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
  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://docker to display the start page.

  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

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.

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

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

General?

  • Automatically check for updates - 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.

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

Shared Drives?

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

You will be asked to provide your Windows system username and password 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.

Advanced?

  • 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 enable VPN compatibilty mode to allow Docker for Windows networking to work on a VPN.

  • NAT Virtual Switch - You can specify a NAT prefix and subnet mask.

  • DNS Server - You can configure a static IP address for the DNS server.

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

Diagnose and Feedback?

If you encounter problems for which you do not find solutions in this documentation or on the Docker for Windows forum, we can help you troubleshoot the log data.

You’ll get a diagnostic ID for that set of logs, and the option to copy the ID and open theforum.

Reset?

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

  • Import 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?

 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
win10安装docker
Windows Server 2016 安装 Docker的过程及遇到问题
Win10下使用Docker运行redis
windows server 2016安装docker
手把手教你,docker安装nginx
One java.exe for all java versions
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服