你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

New-AzContainerAppInitContainerTemplateObject

Create an in-memory object for InitContainer.

Syntax

New-AzContainerAppInitContainerTemplateObject
   [-Arg <String[]>]
   [-Command <String[]>]
   [-Env <IEnvironmentVar[]>]
   [-Image <String>]
   [-Name <String>]
   [-ResourceCpu <Double>]
   [-ResourceMemory <String>]
   [-VolumeMount <IVolumeMount[]>]
   [<CommonParameters>]

Description

Create an in-memory object for InitContainer.

Examples

Example 1: Create an in-memory object for InitContainer.

New-AzContainerAppInitContainerTemplateObject -Image "mcr.microsoft.com/k8se/quickstart:latest" -Name "simple-hello-world-container2" -ResourceCpu 0.25 -ResourceMemory "0.5Gi" -Command "/bin/sh" -Arg "-c","while true; do echo hello; sleep 10;done"

Image                                    Name                          ResourceCpu ResourceEphemeralStorage ResourceMemory
-----                                    ----                          ----------- ------------------------ --------------
mcr.microsoft.com/k8se/quickstart:latest simple-hello-world-container2 0.25                                 0.5Gi

Create an in-memory object for InitContainer.

Parameters

-Arg

Container start command arguments.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Command

Container start command.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Env

Container environment variables.

Type:IEnvironmentVar[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Image

Container image tag.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Custom container name.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceCpu

Required CPU in cores, e.g. 0.5.

Type:Double
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceMemory

Required memory, e.g. "250Mb".

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VolumeMount

Container volume mounts.

Type:IVolumeMount[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

InitContainer