- Hands-On Kubernetes on Windows
- Piotr Tylenda
- 329字
- 2021-06-24 16:53:58
Running LCOW containers
By default, Docker Desktop for Windows hosts Linux containers using MobyLinuxVM, which provides a minimal, fully-functional environment for hosting Linux containers. This approach is meant only for development and testing purposes as it is not available on Windows Server. Windows Server currently has experimental support for LCOW and it is also possible to enable this feature in Docker Desktop.
To enable LCOW support in Docker Desktop, you have to enable experimental features in the Docker Daemon. Let's take a look:
- Open the Docker Desktop tray icon and select Settings.
- Navigate to the Daemon tab.
- Enable the Experimental features checkbox:
- Apply the changes. Docker Desktop will restart.
Open PowerShell and create a container that uses Linux as the base image by providing the --platform=linux parameter to docker run. In this example, we're creating a busybox container in interactive mode and starting a Bourne shell:
docker run --rm -it --platform=linux busybox /bin/sh
After the container is started, the Bourne shell prompt will appear (/ #). Now, you can verify that you are indeed running inside a Linux container by using the uname command, which prints Linux kernel information:
uname -a
The following screenshot shows the output of the preceding command:
In a separate Powershell window, without closing the Bourne shell in the container, execute the docker inspect <containerId> command in order to verify that the container is indeed running using LCOW using Hyper-V isolation:
In this section, you learned how to install Docker Desktop for Windows tooling and how to verify its functionality, including running Linux containers on Windows. In the next section, you will learn how to approach building your first Windows container image with the help of Visual Studio Code.
- Git Version Control Cookbook
- ASP.NET MVC4框架揭秘
- Getting started with Google Guava
- INSTANT OpenCV Starter
- vSphere High Performance Cookbook
- Python Deep Learning
- PHP+MySQL網站開發項目式教程
- Spring Boot進階:原理、實戰與面試題分析
- Android Wear Projects
- Building Microservices with .NET Core
- 超簡單:Photoshop+JavaScript+Python智能修圖與圖像自動化處理
- 美麗洞察力:從化妝品行業看顧客需求洞察
- 趣學數據結構
- 計算機應用基礎
- 軟件自動化測試實戰解析:基于Python3編程語言