gpt4 book ai didi

docker - 如何在 Azure Service Fabric 中为 docker 容器指定命令行参数

转载 作者:行者123 更新时间:2023-12-02 18:21:07 25 4
gpt4 key购买 nike

我有一个 docker 镜像 wiremock.net-nano它接受额外的命令行参数,如 --Port--AdminUsername .

正常的 docker 命令行看起来像:

docker run --rm -p 9091:80 sheyenrath/wiremock.net-nano --ReadStaticMappings true --AdminUsername x --AdminPassword y --RequestLogExpirationDuration 24


但是如何在 Azure Service Fabric 中配置这些参数?
ServiceManifest.xml 文件仅定义图像名称 (<ImageName>sheyenrath/wiremock.net-nano</ImageName>) 和端口转发 (<Endpoint Name="WireMock_ContainerTypeEndpoint" Port="9091" />)。

最佳答案

如果我没记错的话 <ContainerHostEntryPointType>/<Commands>在元素中是你要找的东西。

根据 ServiceManifest.xml schema :

Pass a comma delimited list of commands to the container.

架构摘录:

<xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/2011/01/fabric" name="ContainerHostEntryPointType">
<xs:sequence>
<!--container image name-->
<xs:element name="ImageName" type="xs:string">
<xs:annotation>
<xs:documentation>The repo and image on https://hub.docker.com or Azure Container Registry.</xs:documentation>
</xs:annotation>
</xs:element>
<!--comma delimited list of commands for container-->
<xs:element name="Commands" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Pass a comma delimited list of commands to the container.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="EntryPoint" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="FromSource" type="xs:string" minOccurs="0" maxOccurs="1"/>
</xs:sequence>

关于docker - 如何在 Azure Service Fabric 中为 docker 容器指定命令行参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52668237/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com