Tag an image on a specific host
/api/v2/images/{image_id}/hosts/{host_id}/tag
Use this endpoint to tag an image on a specific host.
Images can have multiple tags all linked to the same image. Tags are used for readability, as well as to specify which registry they are stored on. Images with a simple tag such as oraclelinux:latest imply that the image is stored on io.docker.com. By tagging an image with a hostname, the registry is specified. For example, docker.oraclecorp.com/oraclelinux:latest would use a registry host of docker.oraclecorp.com.
Request
- application/json
-
host_id: string
host_id
-
image_id: string
image_id
-
Authorization: apiKey
Type:
apiKey
Response
- application/json
200 Response
Default Response
Examples
The following example shows how to tag an image. You perform this task by submitting a POST request to the REST resource using cURL. For more information about cURL, see Use cURL.
Note: The command in this example uses the URL structure https://rest_server_url/resource-path
, where rest_server_url
is the manager node for the Oracle Cloud Container instance. See Send Requests for the appropriate URL structure to use for Oracle Public Cloud.
cURL Command
curl -sk
-X "POST"
-H "Authorization: Bearer b39f09c71c297f1d"
"https://rest_server_url/api/v2/images/sha256:2aabafe89cbffe63a812e3965137f36df73488488a6ad4ba641272a3cf384cd1/hosts/host_id/tag"
-d '{"host_id":"host_id",
"image_id":"sha256:94f2f3f7c518d638f3c5f14f6983f60d9a18d7d239b4d5b0d7bd62c43fb8489c",
"Repo":"docker.oracle.com",
"Tag":"newest"}'
Example of Response Body
{
"task_id": "caffeb3a-f487-499e-b9bf-c8e7f1c95b09"
}