【问题标题】:how to set repoLayoutRef by code for remote docker如何通过远程 docker 的代码设置 repoLayoutRef
【发布时间】:2020-07-14 13:08:19
【问题描述】:

当使用 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>

【问题讨论】:

  • 如果我卷曲看结果:

标签: docker artifactory jfrog-container-registry


【解决方案1】:

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

remoteRepositories:
  test-docker:
    type: docker
    url: https://dockerproxy.mydomain
    enableTokenAuthentication: true
    repoLayout: simple-default

【讨论】:

  • 谢谢!当您在手动设置后通过 curl 获取配置时,我正在寻找 xml 文件中描述的 repoLayoutRef。
猜你喜欢
  • 1970-01-01
  • 2011-06-05
  • 1970-01-01
  • 2011-11-08
  • 1970-01-01
  • 1970-01-01
  • 2013-03-17
  • 2013-03-12
  • 1970-01-01
相关资源
最近更新 更多