0

当使用 yaml 文件在 docker 中声明远程 docker 存储库时(请参阅https://www.jfrog.com/confluence/display/JFROG/Artifactory+YAML+Configuration),我无法将 repoLayoutRef 设置为 simple-default。如果我想通过 GUI 保存他的定义,我看到必须设置 repoLayoutRef 定义,所以我认为它是强制性的。如果未设置 repoLayout,则 docker 远程存储库不起作用。

yaml 文件不允许设置它

我尝试使用 param.yaml 的内容

remoteRepositories
  docker-via-intranet:
    type: docker
    url: https://dockerproxy.mydomain
    proxy: intranet-proxy
    enableTokenAuthentication: true
export BASE_URL="http://localhost:8081/artifactory"
export AUTH=" -u admin:((jcr_admin_password))"

curl $AUTH -X PATCH "http://localhost:8081/artifactory/api/system/configuration" -H "Content-Type:application/yaml" -T param.yml

如果我查看生成的 yaml 内部,我可以看到必填字段不存在:
<repoLayoutRef>simple-default<repoLayoutRef>

看:

      <remoteRepository>
            <key>docker-via-intranet</key>
            <type>docker</type>
            <includesPattern>**/*</includesPattern>
            <dockerApiVersion>V2</dockerApiVersion>
            <forceNugetAuthentication>false</forceNugetAuthentication>
            <blackedOut>false</blackedOut>
            <handleReleases>true</handleReleases>
            <handleSnapshots>true</handleSnapshots>
            <maxUniqueSnapshots>0</maxUniqueSnapshots>
            <maxUniqueTags>0</maxUniqueTags>
            <blockPushingSchema1>true</blockPushingSchema1>
            <suppressPomConsistencyChecks>true</suppressPomConsistencyChecks>
            <propertySets/>
            <archiveBrowsingEnabled>false</archiveBrowsingEnabled>
            <url>https://registry-1.docker.io/</url>
            <offline>false</offline>
            <hardFail>false</hardFail>
            <storeArtifactsLocally>true</storeArtifactsLocally>
            <fetchJarsEagerly>false</fetchJarsEagerly>
            <fetchSourcesEagerly>false</fetchSourcesEagerly>
            <retrievalCachePeriodSecs>7200</retrievalCachePeriodSecs>
            <assumedOfflinePeriodSecs>300</assumedOfflinePeriodSecs>
           <unusedArtifactsCleanupPeriodHours>0</unusedArtifactsCleanupPeriodHours>
            <shareConfiguration>false</shareConfiguration>
            <synchronizeProperties>false</synchronizeProperties>
            <listRemoteFolderItems>true</listRemoteFolderItems>
            <rejectInvalidJars>false</rejectInvalidJars>
            <blockMismatchingMimeTypes>true</blockMismatchingMimeTypes>
            <bypassHeadRequests>false</bypassHeadRequests>
            <allowAnyHostAuth>false</allowAnyHostAuth>
            <socketTimeoutMillis>15000</socketTimeoutMillis>
            <enableCookieManagement>false</enableCookieManagement>
            <enableTokenAuthentication>false</enableTokenAuthentication>
            <proxyRef>internet-proxy</proxyRef>
            <propagateQueryParams>false</propagateQueryParams>
        </remoteRepository>
4

1 回答 1

1

您应该使用“repoLayout”参数来设置存储库布局,例如:

remoteRepositories:
  test-docker:
    type: docker
    url: https://dockerproxy.mydomain
    enableTokenAuthentication: true
    repoLayout: simple-default
于 2020-04-02T21:29:55.733 回答