简体   繁体   中英

Using Docker API to push to private registry

What is the syntax to push an image to a private registry?

From the documentation, I would expect the below to work:

curl -X POST -i "http://localhost:2375/images/localhost:5000/oillio/my_app:1.0-SNAPSHOT/push"

I can use the CLI to do this:

docker push localhost:5000/oillio/my_app:1.0-SNAPSHOT

This works fine. But I can't figure out what the syntax is to do this from the API. When I try the above, I get a status 500 response with the text "EOF"

The tag needs to be as a parameter and not within the url:

/images/<imageName>/push?tag=<tadName>

Note that you will also need the X-Registry-Auth header.

a working example:

curl -X POST -H "X-Registry-Auth:787f5fe5195c40ef924ac8d67948e15a" http://172.19.32.116:8833/images/172.19.32.116:5000/test7/push

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