Run a Container from an Image
/api/v2/images/{repo_id:.*}/hosts/{host_id}/run
Request
- application/json
-
host_id: string
host_id
-
repo_id:.*: string
repo_id:.*
-
Authorization: apiKey
Type:
apiKey
Response
- application/json
200 Response
Default Response
Examples
The following example shows how to run a container from a specific 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/oraclelinux:6.6/hosts/host_id/run"
-d '{"content":"version: 2\nservices:\n unnamed:\n image: \"oraclelinux:6.6\"\n"}'
In this example, oraclelinux
is the repository in the registry and 6.6
is the optional container tag. If you do not include the tag, then Oracle Container Cloud Service assumes the value of the tag is latest
.
Example of Response Body
{
"task_id": "602784b9-143c-4109-92d9-f66ff1010d07"
}