有关 Azure 容器实例的常见问题解答Frequently asked questions about Azure Container Instances

本文解答有关 Azure 容器实例的常见问题。This article addresses frequently asked questions about Azure Container Instances.

部署Deployment

容器映像的最大大小是什么?How large can my container image be?

可在 Azure 容器实例上部署的容器映像的最大大小为 15 GB。The maximum size for a deployable container image on Azure Container Instances is 15 GB. 根据部署时的确切可用性,也许可以部署更大的映像,但不保证可以做到这一点。You might be able to deploy larger images depending on the exact availability at the moment you deploy, but this is not guaranteed.

容器映像的大小会影响部署所需的时间,因此,一般情况下,我们会尽可能地保留较小的容器映像。The size of your container image impacts how long it takes to deploy, so generally you want to keep your container images as small as possible.

如何加速容器的部署?How can I speed up the deployment of my container?

由于部署速度的主要决定因素之一是映像大小,因此请找到减小大小的办法。Because one of the main determinants of deployment times is the image size, look for ways to reduce the size. 删除不需要的层,或者减小映像中的层大小(选择较精简的基础 OS 映像)。Remove layers you don't need, or reduce the size of layers in the image (by picking a lighter base OS image). 例如,如果运行 Linux 容器,请考虑使用 Alpine 作为基础映像,而不是使用完整的 Ubuntu Server。For example, if you're running Linux containers, consider using Alpine as your base image rather than a full Ubuntu Server. 同样,对于 Windows 容器,请尽可能地使用 Nano Server 基础映像。Similarly, for Windows containers, use a Nano Server base image if possible.

还应查看 Azure 容器映像中预缓存映像的列表(通过列出缓存的映像 API 获取)。You should also check the list of pre-cached images in Azure Container Images, available via the List Cached Images API. 也许可以换出某个预缓存映像的映像层。You might be able to switch out an image layer for one of the pre-cached images.

有关如何减少容器启动时间,请参阅更详细的指南See more detailed guidance on reducing container startup time.

支持哪些 Windows 基础 OS 映像?What Windows base OS images are supported?

备注

由于 Windows 在 2020 年更新后存在后向兼容性问题,因此以下映像版本包括我们建议你在基础映像中使用的最低版本号。Due to issues with backwards compatibility after the Windows updates in 2020, the following image versions include the minimum version number that we recommend you use in your base image. 使用较旧映像版本的当前部署不受影响,但新部署应遵循以下基础映像的要求。Current deployments using older image versions are not impacted, but new deployments should adhere to the following base images.

Windows Server 2016 基础映像Windows Server 2016 base images

备注

不支持基于半年频道版本 1709 或 1803 的 Windows 映像。Windows images based on Semi-Annual Channel release 1709 or 1803 are not supported.

Windows Server 2019 和客户端基础映像(预览版)Windows Server 2019 and client base images (preview)

应在容器中使用哪个 .NET 或 .NET Core 映像层?What .NET or .NET Core image layer should I use in my container?

使用符合要求的最小映像。Use the smallest image that satisfies your requirements. 对于 Linux,可以使用 runtime-alpine .NET Core 映像,从 .NET Core 2.1 版本开始就已支持此映像。For Linux, you could use a runtime-alpine .NET Core image, which has been supported since the release of .NET Core 2.1. 对于 Windows,如果使用完整的 .NET Framework,则需要使用 Windows Server Core 映像(仅限运行时的映像,例如 4.7.2-windowsservercore-ltsc2016)。For Windows, if you are using the full .NET Framework, then you need to use a Windows Server Core image (runtime-only image, such as 4.7.2-windowsservercore-ltsc2016). 仅限运行时的映像较小,但不支持需要 .NET SDK 的工作负荷。Runtime-only images are smaller but do not support workloads that require the .NET SDK.

可用性和配额Availability and quotas

应为容器或容器组分配多少核心和内存?How many cores and memory should I allocate for my containers or the container group?

这实际上取决于工作负荷。This really depends on your workload. 请从较小的数量着手,并测试容器的性能如何。Start small and test performance to see how your containers do. 监视 CPU 和内存资源用量,然后根据在容器中部署的进程类型增加核心或内存。Monitor CPU and memory resource usage, and then add cores or memory based on the kind of processes that you deploy in the container.

另外,请务必检查所部署到的区域的资源可用性,以确定每个容器组的可用 CPU 核心数和内存上限。Make sure also to check the resource availability for the region you are deploying in for the upper bounds on CPU cores and memory available per container group.

备注

服务的底层基础结构使用了容器组的少量资源。A small amount of a container group's resources is used by the service's underlying infrastructure. 容器将能够访问分配给该组的大部分而不是全部资源。Your containers will be able to access most but not all of the resources allocated to the group. 因此,为组中的容器请求资源时,请规划一个小型资源缓冲区。For this reason, plan a small resource buffer when requesting resources for containers in the group.

ACI 在哪个底层基础结构上运行?What underlying infrastructure does ACI run on?

Azure 容器实例旨在用作无服务器按需容器服务,因此,我们希望你专注于开发容器,而不用考虑基础结构!Azure Container Instances aims to be a serverless containers-on-demand service, so we want you to be focused on developing your containers, and not worry about the infrastructure! 对于那些有好奇心的或者想要比较性能的客户,可以在采用各种 SKU 的 Azure VM 集(主要是 F 和 D 系列)上运行 ACI。For those that are curious or wanting to do comparisons on performance, ACI runs on sets of Azure VMs of various SKUs, primarily from the F and the D series. 我们会持续开发和优化服务,预计这种情况将来会改变。We expect this to change in the future as we continue to develop and optimize the service.

我想要在 ACI 上部署几千个核心 - 是否可以提高配额?I want to deploy thousand of cores on ACI - can I get my quota increased?

在某些情况下是可以提高的。Yes (sometimes). 有关当前的配额以及可以请求提高的限制,请参阅配额和限制一文。See the quotas and limits article for current quotas and which limits can be increased by request.

是否可以部署 4 个以上的核心和 16 GB 以上的 RAM?Can I deploy with more than 4 cores and 16 GB of RAM?

还不可以。Not yet. 目前这些数字是容器组的上限。Currently, these are the maximums for a container group. 如有具体的要求和请求,请联系 Azure 支持部门。Contact Azure Support with specific requirements or requests.

ACI 何时在特定的区域推出?When will ACI be in a specific region?

此处发布了当前推出的区域。Current region availability is published here. 如果你在特定的区域需要满足某项要求,请联系 Azure 支持部门。If you have a requirement for a specific region, contact Azure Support.

功能和方案Features and scenarios

如何缩放容器组?How do I scale a container group?

目前,容器或容器组不可缩放。Currently, scaling is not available for containers or container groups. 如果需要运行更多实例,请使用我们的 API 进行自动化,并创建更多请求以在服务中创建容器组。If you need to run more instances, use our API to automate and create more requests for container group creation to the service.

自定义 VNet 中运行的实例可以使用哪些功能?What features are available to instances running in a custom VNet?

可以在所选 Azure 虚拟网络中部署容器组,并将专用 IP 委托给容器组,以在 VNet 中跨 Azure 资源路由流量。You can deploy container groups in an Azure virtual network of your choice, and delegate private IPs to the container groups to route traffic within the VNet across your Azure resources. 有关 Azure 容器实例的网络方案和限制,请参阅虚拟网络方案和资源For networking scenarios and limitations with Azure Container Instances, see Virtual network scenarios and resources.

定价Pricing

计量器何时开始运行?When does the meter start running?

计算的容器组持续时间从我们开始提取你的第一个容器映像(对于新部署)或重启容器组(如果已部署)开始,到容器组停止为止。Container group duration is calculated from the time that we start to pull your first container's image (for a new deployment) or your container group is restarted (if already deployed), until the container group is stopped. 请参阅容器实例定价中的详细信息。See details at Container Instances pricing.

停止容器后是否会停止计费?Do I stop being charged when my containers are stopped?

停止整个容器组后,计量器将停止运行。Meters stop running once your entire container group is stopped. 只要容器组中的容器正在运行,我们就会保留资源,以防需要再次启动容器。As long as a container in your container group is running, we hold the resources in case you want to start the containers up again.

后续步骤Next steps