- 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.
- Learn ECMAScript(Second Edition)
- Python零基礎快樂學習之旅(K12實戰訓練)
- Learn React with TypeScript 3
- 程序員修煉之道:通向務實的最高境界(第2版)
- Python深度學習:基于TensorFlow
- 領域驅動設計:軟件核心復雜性應對之道(修訂版)
- Service Mesh實戰:基于Linkerd和Kubernetes的微服務實踐
- Mastering Python Design Patterns
- Clojure for Java Developers
- Android系統下Java編程詳解
- C#面向對象程序設計(第2版)
- Xamarin Cross-Platform Development Cookbook
- 算法超簡單:趣味游戲帶你輕松入門與實踐
- Ionic3與CodePush初探:支持跨平臺與熱更新的App開發技術
- 輕松學Scratch 3.0 少兒編程(全彩)