- Docker on Windows
- Elton Stoneman
- 580字
- 2021-07-02 12:47:53
Docker Desktop
Docker Desktop is available from Docker Hub – you can find it by navigating to https://dockr.ly/docker-for-windows. You can choose between the Stable channel and the Edge channel. Both channels give you the community Docker Engine, but the Edge channel follows the monthly release cycle, and you will get experimental features. The Stable channel tracks the Docker Engine release cycle, with quarterly updates.
You need to download and run the installer. The installer will verify that you can run Docker in your setup and will configure the Windows features needed to support Docker. When Docker is running, you will see a whale icon in the notification bar, which you can right-click on for options:

You need to select Switch to Windows containers... before you do anything else. Docker Desktop on Windows can run Linux containers by running Docker inside a Linux VM on your machine. This is great for testing out Linux apps to see how they run in containers, but this book is all about Windows containers – so switch over, and Docker will remember this setting in future.
While Docker for Windows is running, you can open Command Prompt or a PowerShell session and start working with containers. First, verify that everything is working as expected by running docker version. You should see an output similar to this code snippet:
> docker version
Client: Docker Engine - Community
Version: 18.09.2
API version: 1.39
Go version: go1.10.8
Git commit: 6247962
Built: Sun Feb 10 04:12:31 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.24)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 04:28:48 2019
OS/Arch: windows/amd64
Experimental: true
Now run a simple container with the Docker CLI:
docker container run dockeronwindows/ch01-whale:2e
This uses a public image on Docker Hub – one of the sample images for this book, which Docker will pull the first time you use it. If you don't have any other images, this will take a few minutes, as it will also download the Microsoft Nano Server image, which my image uses as a base. When the container runs, it shows some ASCII art and then exits. Run the same command again, and you will see that it executes much more quickly as the images are now cached locally.
Docker Desktop checks for updates when it starts and will prompt you to download a new version when it's ready. You can keep your Docker tools up to date just by installing new versions when they're released. You can check the current versions you have installed by selecting About Docker Desktop from the taskbar menu:

That's all the setup you need. Docker Desktop also contains the Docker Compose tool I'll be using later in the book, so you're all set to follow along with the code samples.
- 30天自制操作系統(tǒng)
- Windows Server 2019 Cookbook
- 嵌入式Linux開發(fā)技術(shù)
- Arch Linux Environment Setup How-to
- Kubernetes從入門到實(shí)踐
- 深入理解eBPF與可觀測(cè)性
- Dreamweaver CS5.5 Mobile and Web Development with HTML5,CSS3,and jQuery
- 計(jì)算機(jī)系統(tǒng):基于x86+Linux平臺(tái)
- VMware Horizon View Essentials
- 分布式系統(tǒng)設(shè)計(jì)實(shí)踐
- Linux軟件管理平臺(tái)設(shè)計(jì)與實(shí)現(xiàn)
- UI設(shè)計(jì)手繪表現(xiàn)從入門到精通
- Linux 從入門到項(xiàng)目實(shí)踐(超值版)
- 鴻蒙HarmonyOS應(yīng)用開發(fā)入門
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)(Windows 7+Office 2010)