2

我正在尝试获取一个 docker 映像来运行我们的本地 Service Fabric 群集。

我们已经在我们的本地网络上设置了一个服务结构集群,它似乎运行良好(它已经运行了 2 个 docker 映像)。我正在寻找我的一个容器在域用户(服务帐户)下运行,以便我可以访问我的网络中的 SMB 共享(已被授予服务帐户的权限)。

我收到以下错误:

错误事件:SourceId='System.Hosting',Property='Activation:1.0'。激活过程中出错。无法设置 ApplicationPrincipals。错误:ApplicationPrincipalAbortableError

也显示为图像:在此处输入图像描述

我试图运行的容器:https ://hub.docker.com/r/stefanscherer/registry-windows/

应用程序清单.xml

<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest ApplicationTypeName="[REMOVED].ServiceFabric.WindowsContainerRegistryType"
                     ApplicationTypeVersion="1.0.0"
                     xmlns="http://schemas.microsoft.com/2011/01/fabric"
                     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameters>
        <Parameter Name="WindowsContainerRegistry_InstanceCount" DefaultValue="-1" />
    </Parameters>
    <!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion 
       should match the Name and Version attributes of the ServiceManifest element defined in the 
       ServiceManifest.xml file. -->
    <ServiceManifestImport>
        <ServiceManifestRef ServiceManifestName="WindowsContainerRegistryPkg" ServiceManifestVersion="1.0.0" />
        <ConfigOverrides />
        <Policies>
            <ContainerHostPolicies CodePackageRef="Code">
                <!-- See https://aka.ms/I7z0p9 for how to encrypt your repository password -->
                <RepositoryCredentials AccountName="" Password="" PasswordEncrypted="false" />
                <PortBinding ContainerPort="5000" EndpointRef="WindowsContainerRegistryTypeEndpoint" />
                <Volume Source="\\[REMOVED]\ServiceFabricShare" Destination="C:\registry" IsReadOnly="false"></Volume>
            </ContainerHostPolicies>
        </Policies>
    </ServiceManifestImport>
    <DefaultServices>
        <!-- The section below creates instances of service types, when an instance of this 
         application type is created. You can also create one or more instances of service type using the 
         ServiceFabric PowerShell module.

         The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. -->
        <Service Name="WindowsContainerRegistry" ServicePackageActivationMode="ExclusiveProcess">
            <StatelessService ServiceTypeName="WindowsContainerRegistryType" InstanceCount="[WindowsContainerRegistry_InstanceCount]">
                <SingletonPartition />
            </StatelessService>
        </Service>
    </DefaultServices>
    <Principals>
        <Users>
            <User Name="ServiceFabricAppl" AccountType="DomainUser" AccountName="[REMOVED]\appl_ServiceFabric" Password="[REMOVED]" PasswordEncrypted="false" />
        </Users>
    </Principals>
    <Policies>
        <DefaultRunAsPolicy UserRef="ServiceFabricAppl" />
    </Policies>
</ApplicationManifest>

PS我使用未加密的密码只是为了测试目的,以确保这不是现在的问题。

服务清单.xml

<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="WindowsContainerRegistryPkg"
                 Version="1.0.0"
                 xmlns="http://schemas.microsoft.com/2011/01/fabric"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ServiceTypes>
    <!-- This is the name of your ServiceType.
         The UseImplicitHost attribute indicates this is a guest service. -->
    <StatelessServiceType ServiceTypeName="WindowsContainerRegistryType" UseImplicitHost="true">
        <Extensions>
            <Extension Name="Traefik">
                <Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
                    <Label Key="traefik.frontend.rule">Host:registry.windows.containers.[REMOVED].com</Label>
                    <Label Key="traefik.enable">true</Label>
                    <Label Key="traefik.frontend.passHostHeader">true</Label>
                    <!--<Label Key="traefik.port">5000</Label>
                    <Label Key="traefik.protocol">http</Label>
                    <Label Key="traefik.frontend.entryPoints">http,https</Label>
                    <Label Key="traefik.frontend.headers.referrerPolicy">no-referrer</Label>-->
                </Labels>
            </Extension>
        </Extensions>
    </StatelessServiceType>
  </ServiceTypes>

  <!-- Code package is your service executable. -->
  <CodePackage Name="Code" Version="1.0.0">
    <EntryPoint>
      <!-- Follow this link for more information about deploying Windows containers to Service Fabric: https://aka.ms/sfguestcontainers -->
      <ContainerHost>
          <ImageName>stefanscherer/registry-windows:2.6.2-2016</ImageName>
      </ContainerHost>
    </EntryPoint>
    <!-- Pass environment variables to your container: -->
    <!--
    <EnvironmentVariables>
      <EnvironmentVariable Name="VariableName" Value="VariableValue"/>
    </EnvironmentVariables>
    -->
  </CodePackage>

  <!-- Config package is the contents of the Config directoy under PackageRoot that contains an 
       independently-updateable and versioned set of custom configuration settings for your service. -->
  <ConfigPackage Name="Config" Version="1.0.0" />

  <Resources>
    <Endpoints>
      <!-- This endpoint is used by the communication listener to obtain the port on which to 
           listen. Please note that if your service is partitioned, this port is shared with 
           replicas of different partitions that are placed in your code. -->
      <Endpoint Name="WindowsContainerRegistryTypeEndpoint" Port="5000" />
    </Endpoints>
  </Resources>
</ServiceManifest>

资料来源:

4

0 回答 0