如何通过远程代码设置 repoLayoutRef docker
how to set repoLayoutRef by code for remote docker
当使用 yaml 文件(参见 https://www.jfrog.com/confluence/display/JFROG/Artifactory+YAML+Configuration)在 docker 中声明远程 docker 存储库时,我无法将 repoLayoutRef 设置为简单默认值。
如果我想通过 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>
您应该使用 "repoLayout" 参数来设置存储库布局,例如:
remoteRepositories:
test-docker:
type: docker
url: https://dockerproxy.mydomain
enableTokenAuthentication: true
repoLayout: simple-default
当使用 yaml 文件(参见 https://www.jfrog.com/confluence/display/JFROG/Artifactory+YAML+Configuration)在 docker 中声明远程 docker 存储库时,我无法将 repoLayoutRef 设置为简单默认值。 如果我想通过 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>
您应该使用 "repoLayout" 参数来设置存储库布局,例如:
remoteRepositories:
test-docker:
type: docker
url: https://dockerproxy.mydomain
enableTokenAuthentication: true
repoLayout: simple-default