简体   繁体   中英

Unable to download docker image layer from JFrog Artifactory using curl

I am using the command:

curl -O -u username:API_KEY https://artifactory_url/artifactory/docker_repo/image/tag/sha

The file created after curl completes successfully is empty

This could happen if redirect download feature is enabled on Artifactory side. The reason is, when a repository is configured to redirect downloads, a client requesting Artifactory for an artifact(exceeding a specific file size) hosted in that repository receives a 302 response initially with a Location header containing a signed direct download url. Then the client uses the particular URL to download the actual file.

Hence we would need to make sure follow redirect option is enabled by the client attempting to download it. In case of curl it can be achieved by adding -L

curl -O -L -u username:API_KEY https://artifactory_url/artifactory/docker_repo/image/tag/sha

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM