如何在Azure Service Fabric中为Docker容器指定命令行参数 [英] How to specify commandline arguments to a docker container in Azure Service Fabric

查看:131
本文介绍了如何在Azure Service Fabric中为Docker容器指定命令行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个docker映像 wiremock.net-nano ,它接受其他命令行参数,例如--Port--AdminUsername.

I've a docker image wiremock.net-nano which accepts additional commandline parameters like --Port and --AdminUsername.

正常的docker命令行如下所示:

The normal docker commandline looks like:

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" />).


But how can I configure these parameters in Azure Service Fabric?
The ServiceManifest.xml file defines only the image name (<ImageName>sheyenrath/wiremock.net-nano</ImageName>) and port forwarding (<Endpoint Name="WireMock_ContainerTypeEndpoint" Port="9091" />).

推荐答案

如果我没有记错的话,元素中的<ContainerHostEntryPointType>/<Commands>就是您想要的.

If I am not mistaken the <ContainerHostEntryPointType>/<Commands> in the element is what you are looking for.

按照ServiceManifest.xml

将逗号分隔的命令列表传递给容器.

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>

这篇关于如何在Azure Service Fabric中为Docker容器指定命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆