你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzContainerInstanceInitDefinitionObject
为 InitContainerDefinition 创建内存中对象
语法
New-AzContainerInstanceInitDefinitionObject
-Name <String>
[-Command <String[]>]
[-EnvironmentVariable <IEnvironmentVariable[]>]
[-Image <String>]
[-VolumeMount <IVolumeMount[]>]
[<CommonParameters>]
说明
为 InitContainerDefinition 创建内存中对象
示例
示例 1:设置 init 容器定义
New-AzContainerInstanceInitDefinitionObject -Name "initDefinition" -Command "/bin/sh -c myscript.sh"
Name
----
initDefinition
此命令使用命令 /bin/sh -c myscript.sh
设置 init 容器定义
参数
-Command
要以 exec 形式在 init 容器中执行的命令。
类型: | String[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-EnvironmentVariable
在 init 容器中设置的环境变量。 若要构造,请参阅 ENVIRONMENTVARIABLE 属性的 NOTES 部分并创建哈希表。
类型: | IEnvironmentVariable[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Image
init 容器的图像。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
init 容器的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-VolumeMount
可用于 init 容器的卷装载。 若要构造,请参阅 VOLUMEMOUNT 属性的 NOTES 部分,并创建哈希表。
类型: | IVolumeMount[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |