头图

image.png
03dbf7b884ad4f66b3534173d719462a.jpg

What is a container application

Traditional virtual machine is the virtualization of hardware resources

a2eaf6d8356cdd8217275b57dea0705f.png

The virtualization level of the container is one level higher than that of the virtual machine. It is the virtualization of the operating system.

abb3ec7249dc549a05f0e8cc771d1d0a.png

A container application is a software package composed of the software itself and dependent components. It can run on a system with a container engine installed.

The composition method of the container application is docker image. The docker image can be divided into multiple layers, the top layer is writable, and the other layers are read-only. The following is an example of a docker image:

82b0e6f6ef205986a63f82a9d4d41376.jpg
Compared with ordinary applications, container applications have the following characteristics:

  • system resource utilization rate

Since the container does not require additional overhead such as hardware virtualization and running a complete operating system, the container has a higher utilization rate of system resources.

  • Start faster

The container application runs on the host kernel and does not need to start a complete operating system, so it can achieve a startup time of seconds or even milliseconds.

  • operating environment is always the same

A common problem in the development process is environmental consistency. The container application provides a complete runtime environment except for the kernel, ensuring the consistency of the application runtime environment.

  • easy migration

The container runtime ensures the consistency of the execution environment, so application migration is easier.

  • easy maintenance and expansion

The hierarchical storage image used by the container engine makes it easier to reuse the repeated parts of the application, and also makes the maintenance and update of the application easier. It is also very simple to further expand the image based on the basic image.

Quickly test container applications

The test process is as follows:

be7034da70e15663ff5cb75e303f61ea.png
Azure Container Instance is a solution that provides a running solution for hosting serverless container applications. It provides the easiest way to run containers, you don't need to manage virtual machines, and you don't need to manage other service environments.

Let's take a look at how to quickly deploy and test a container application:

  1. prepares resource .

After logging in, we first create a resource group.

az group create --name acitest --location eastus

1397d7da8979ea84ecc7fb99b3d588e1.png

  1. deployment application.

That is, put our application in the container warehouse, and then start deployment. We need to write down the content of fqdn in the output:

az container create --resource-group acutest --name mycontainer --image mcr.microsoft.com/

azuredocs/aci-helloworld --dns-name-label aci-my-demo --ports 80

c75c45dae8ee765210f747f23b003c77.png
7b088a89b3a9c8f21c9965d44380c4dd.png

  1. started testing.

51e18fbe8ca8a6b2252116a5cb3b6195.png

  1. Delete the resource and end the test.

az group delete --name acitest

common problem

1. My test application needs to access intranet resources, can I?

Answer: Azure container instances support virtual networks and can access intranet resources. See:

https://docs.microsoft.com/zh-cn/azure/container-instances/container-instances-virtual-network-concepts

2. Does Azure Container Instance support Windows containers?

Answer: Support. Azure container instances support the following Windows Server 2016 and Windows Server 2019. For more information, please refer to:

https://docs.microsoft.com/zh-cn/azure/container-instances/container-instances-faq#what-windows-base-os-images-are-supported

3. Are Azure container instances available in China?

Answer: At present, we have launched Azure container instances in East Second District.

4. Which container registry does Azure container instance support?

Answer: Azure container instance supports docker hub, Azure Container Registry and third-party registry. These registries must be accessible from the Internet.

5. My test environment is expensive and may use thousands of CPU cores. Can I use Azure container instances for testing?

Answer: In some cases, it is possible, but you need to contact the technical support case. For more information, please refer to:

https://docs.microsoft.com/zh-cn/azure/container-instances/container-instances-quotas


微软技术栈
418 声望994 粉丝

微软技术生态官方平台。予力众生,成就不凡!微软致力于用技术改变世界,助力企业实现数字化转型。