Working with Containers in Container Instances
This section describes how to view information about containers in container instances, retrieve log data from a container instance container, and update the name and tags of a container instance container.
Viewing Container Instance Containers
This topic describes how to list all containers for a compartment or a container instance and how to view more information about a specified container instance container.
Using the Compute Web UI
-
On the dashboard, select Containers / Container Instances.
If the container instance that you want to view is not listed, use the Compartment drop-down menu above the container instances list to select the correct compartment.
-
In the container instances list, select the name of the container instance for which you want to view the container.
-
On the container instance details page, scroll to the Resources section, and select Containers.
-
Select the name of the container in the list to show more information about the container, including log data.
Using the OCI CLI
-
List all containers in a specified compartment.
-
Get the OCID of the compartment where you want to list containers:
oci iam compartment list
-
Run the list containers command.
$ oci container-instances container list --compartment-id ocid1.compartment.unique_ID
-
-
List the container in a specified container instance.
-
Get the OCID of the container instance for which you want to view the container:
oci container-instances container-instance list
-
Run the get container instance command to list the container in the container instance.
$ oci container-instances container-instance get --container-instance-id ocid1.container-instance.unique_ID
-
-
Get more information about a specific container.
-
Get the OCID of the container by using one of the two list containers commands.
-
Run the get container command.
$ oci container-instances container get --container-id ocid1.container.unique_ID
-
-
Retrieve log data from a specific container.
-
Get the OCID of the container by using one of the two list containers commands.
-
Retrieve the most recent 256 KB of logs from the specified container.
$ oci container-instances container retrieve-logs --container-id ocid1.container.unique_ID
-
Updating a Container Instance Container
You can change the name and tags of a specified container instance container.
Using the Compute Web UI
-
On the dashboard, select Containers / Container Instances.
-
In the container instances list, select the name of the container instance for which you want to update the container.
-
On the container instance details page, scroll to the Resources section, and select Containers.
-
For the container in the list, select the Actions menu and select Edit.
Using the OCI CLI
-
Get the OCID of the container that you want to update by using one of the following list containers commands:
$ oci container-instances container list --compartment-id compartment_OCID $ oci container-instances container-instance get --container-instance-id ocid1.container-instance.unique_ID
-
Run the update container command.
Example:
$ oci container-instances container update --container-id ocid1.container.unique_ID \ --display-name new_name --defined-tags new_tags --force