This article is a mirror article of machine translation, please click here to jump to the original article.

View: 5419|Reply: 2

Docker builds images on top of Windows systems

[Copy link]
Posted on 6/2/2023 9:18:24 PM | | | |
Requirements: Some old projects need to run on Windows, or the project needs to call some com components to get the results, at this time, we can only build images based on Windows and run Windows-based containers.

About Windows ContainersMicrosoft's official documentation:The hyperlink login is visible.

Windows base image

Microsoft provides several images, called base images, from which you can start building your own container images:

  • Windows - Contains the full set of Windows APIs and system services (except for server roles).
  • Windows Server - Contains the full suite of Windows APIs and system services.
  • Windows Server Core - A smaller image that contains some of the Windows Server APIs - the full .NET Framework. It also includes most, but not all, server roles, such as not including a fax server.
  • Nano Server - The smallest Windows Server image, including support for .NET Core APIs and certain server roles.


The image with the suffix name insider is the build, which is actually the same as the versionPreview

Remember,The Windows container base image is divided into two layers: the RTM layer and the patch layer, which contains the latest security fixes for OS libraries and binaries overlaid on the RTM layer. The patch layer size fluctuates throughout the lifetime of the container image support cycle, increasing or shrinking month by month depending on the incremental change in the binary. When you pull a Windows container base image on a new host, you must pull both layers at the same time.

Introduction to Container Base Images:The hyperlink login is visible.
Mirror Hub address:The hyperlink login is visible.

OS requirements

The requirements for Windows container hosts are listed as follows:

  • The Windows Containers feature is available in Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10 Pro and Enterprise editions (versions 1607 and later), and Windows 11 Pro and Enterprise.
  • Hyper-V roles must be installed before running Hyper-V isolation operations.
  • The Windows Server container host must install Windows to c:. There is no such limitation if you only deploy Hyper-V isolated containers.


Windows 11 Install Docker Desktop

Download Address:The hyperlink login is visible.

Once installed, set the default container type to Windows container. To switch after the installation is complete, you can use the Docker item in the Windows system taskbar, as shown in the image below:



Containers feature is disabled. Enable it using the PowerShell script (in an administrative PowerShell) and restart your computer before using Docker Desktop:

Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All


If you encounter the above error, run Window Terminal (Windows PowerShell) as an administrator with the following command:

After doing so, you need to restart your computer. Then set the type to Windows container again, and after the switch is successful, as shown in the figure below:



Dockerfile build image

Create a new Dockerfile file with the following contents:

For more Dockerfile examples, please refer to:The hyperlink login is visible.

To build a new image, the command is as follows:



Run containers

Finally, create a container based on the image with the following command:

Try using a browser to access:http://127.0.0.1:5006/, as shown in the figure below:



Successfully access the IIS default site inside the container.

(End)





Previous:.NET/C# RSA PEM format encryption and decryption
Next:ASP.NET Core (20) Prevent open redirect attacks
 Landlord| Posted on 6/2/2023 9:19:28 PM |
review

Docker builds online mind maps based on draw.io
https://www.itsvse.com/thread-10597-1-1.html

【Practical Action】Use Docker to build a Gitlab private repository
https://www.itsvse.com/thread-10408-1-1.html

Prohibiting Docker containers from accessing the Internet (extranet)
https://www.itsvse.com/thread-10401-1-1.html

Docker uses Macvlan to set an independent IP address for containers
https://www.itsvse.com/thread-10389-1-1.html

【Practical Combat】Build Thunder Download and DLNA Services for Home Media Docker
https://www.itsvse.com/thread-10377-1-1.html

Docker modifies and restricts container CPU, memory, and other resources
https://www.itsvse.com/thread-10344-1-1.html

Practical Operation: Using Docker to Build DNS Service (dnsmasq)
https://www.itsvse.com/thread-10321-1-1.html

【Practical Action】Use Docker to build an IPsec VPN server
https://www.itsvse.com/thread-10274-1-1.html

Docker logs fill up disks and data migration
https://www.itsvse.com/thread-10247-1-1.html

Practical use cAdvisor to collect Docker container metrics
https://www.itsvse.com/thread-10243-1-1.html

Deploy SQL Server 2019 database on Docker
https://www.itsvse.com/thread-10186-1-1.html

Deploy the Discuz forum using Docker installation
https://www.itsvse.com/thread-10181-1-1.html

Install the Redis extension based on Docker php:5.6.40-fpm image
https://www.itsvse.com/thread-10176-1-1.html

Install the GD extension based on the Docker php:5.6.40-fpm image
https://www.itsvse.com/thread-10175-1-1.html

The difference between Docker's save and export commands
https://www.itsvse.com/thread-10174-1-1.html

Install curl based on Debian (docker image).
https://www.itsvse.com/thread-10155-1-1.html

Deploy the Elasticsearch service using Docker
https://www.itsvse.com/thread-10148-1-1.html

Docker POI error exception solution
https://www.itsvse.com/thread-10145-1-1.html

The file or folder does not exist when the Docker volume is mounted
https://www.itsvse.com/thread-10144-1-1.html

Docker looks at container restart settings and bulk stop containers
https://www.itsvse.com/thread-10130-1-1.html

Docker deploys war applications to Tomcat containers
https://www.itsvse.com/thread-10125-1-1.html

Docker package conflict issue when installing CentOS 8
https://www.itsvse.com/thread-10115-1-1.html

docker how to remove a none image
https://www.itsvse.com/thread-10112-1-1.html

Docker MySQL solves the problem of too many connections
https://www.itsvse.com/thread-10102-1-1.html

Two tools are recommended for analyzing the Docker image layer
https://www.itsvse.com/thread-10063-1-1.html

Linux Overlay file system in Docker
https://www.itsvse.com/thread-10061-1-1.html

Docker Installs Redis Visual Management Tool (redis-manager)
https://www.itsvse.com/thread-10015-1-1.html

Install Docker containers on CentOS 7
https://www.itsvse.com/thread-9999-1-1.html

Docker builds SFTP services
https://www.itsvse.com/thread-9994-1-1.html

Docker Hub sets up domestic image acceleration
https://www.itsvse.com/thread-9738-1-1.html

Deploy Jaeger distributed link tracing tutorial with Docker
https://www.itsvse.com/thread-9526-1-1.html

Docker repository (3) pushes ASP.NET Core images to Harbor repositories
https://www.itsvse.com/thread-9478-1-1.html

Docker repository (2) Harbor settings to boot up
https://www.itsvse.com/thread-9475-1-1.html

Docker repository (1) Build a private repository based on Harbor
https://www.itsvse.com/thread-9474-1-1.html

docker-ce-3:19.03.13-3.el7.x86_64 requires containerd.io >= 1.2.2-3
https://www.itsvse.com/thread-9449-1-1.html

The Docker installation runs the Redis cache
https://www.itsvse.com/thread-8995-1-1.html

docker container to access external host services
https://www.itsvse.com/thread-8969-1-1.html

Install the ping tool in a container built with Docker
https://www.itsvse.com/thread-8966-1-1.html

Docker upgrade to the latest version
https://www.itsvse.com/thread-8932-1-1.html

Docker stores the image location under the Windows system
https://www.itsvse.com/thread-8922-1-1.html

Difference between dockerfile and docker-compose
https://www.itsvse.com/thread-8921-1-1.html

Docker time inconsistencies, container time time zone setting
https://www.itsvse.com/thread-8865-1-1.html

docker ps error bash: ps: command not found
https://www.itsvse.com/thread-8864-1-1.html

DateTime time in .Net Core is inconsistent with Windows time in Linux Docker
https://www.itsvse.com/thread-8862-1-1.html

[Practical combat] Create a Docker image based on Nginx
https://www.itsvse.com/thread-8800-1-1.html

Docker builds a private image repository
https://www.itsvse.com/thread-8389-1-1.html

Volume sharing is not enabled. Please enable volume totals in Docker CE settings for Windows...
https://www.itsvse.com/thread-7544-1-1.html

CentOS solves the problem that the external network cannot be accessed after the docker port is mapped to the host
https://www.itsvse.com/thread-6959-1-1.html

docker run's --rm option
https://www.itsvse.com/thread-6957-1-1.html

Docker deployment kong-dashboard tutorial
https://www.itsvse.com/thread-5684-1-1.html


CentOS 7 Docker deploys PostgreSQL 9.6
https://www.itsvse.com/thread-5683-1-1.html

Modify the method of port mapping for docker containers
https://www.itsvse.com/thread-5177-1-1.html

Tutorial on deploying rap2 with docker under Centos 7
https://www.itsvse.com/thread-5166-1-1.html

centos installation Docker Compose tutorial
https://www.itsvse.com/thread-5164-1-1.html

How Docker containers and hosts copy files to each other
https://www.itsvse.com/thread-5121-1-1.html

Docker creates an Nginx container
https://www.itsvse.com/thread-5119-1-1.html

Docker container setting up a fixed IP tutorial
https://www.itsvse.com/thread-5116-1-1.html

How to get the IP address of a docker container
https://www.itsvse.com/thread-5115-1-1.html

docker container to view the container linux version
https://www.itsvse.com/thread-5114-1-1.html

Eight real-world Docker use cases
https://www.itsvse.com/thread-5015-1-1.html

Centos7 Docker installation and configuration in practice
https://www.itsvse.com/thread-5014-1-1.html

Docker versions are divided into CE and EE distinctions
https://www.itsvse.com/thread-5013-1-1.html
 Landlord| Posted on 6/3/2023 9:22:24 AM |
Go to the container to view the internal information



Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com