Tag an image on a specific host

post

/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

Supported Media Types
Path Parameters
Body ()
Body parameters
Root Schema : schema
Type: object
Show Source
Security
Back to Top

Response

Supported Media Types

200 Response

200 Response
Body ()
Root Schema : schema
Type: array
Show Source
Nested Schema : items
Type: object
Show Source

Default Response

Error Payload
Body ()
Root Schema : schema
Type: array
Show Source
Back to Top

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"
}
Back to Top