Containers
The containers API allows you to run and manage custom containers on the platform.
First steps
Configuring your container registry
To run images from a private container registry, you need to configure the registry in the platform. You can do this by creating a new container registry resource in the platform and providing the necessary credentials.
You can use the following API operations to manage container registries:
- POST
/
to create a new container registryv2/ projects/ {projectId}/ registries/ - PATCH
/
to update a container registryv2/ registries/ {registryId}/ - DELETE
/
to delete a registryv2/ registries/ {registryId}/
After a container registry is configured for a project, you can simply use it within that project by prefixing the image name, just as you would with a docker run
command.
Starting and updating container stacks
Containers are run as part of a container stack. A container stack is a collection of containers and volumes that are run together. You can use the following API operations to manage container stacks:
- GET
/
to list available stacks (use thev2/ projects/ {projectId}/ stacks/ default
stack) - PUT
/
to declare the desired state of a container stack; this operation is idempotent and can be used to add/update or remove containers and volumes from a stackv2/ stacks/ {stackId}/
Operational tasks
To manage a container stack's lifecycle, you can use the following API operations:
- POST
/
to stop a service in a container stackv2/ stacks/ {stackId}/ services/ {serviceId}/ actions/ stop/ - POST
/
to start a service in a container stackv2/ stacks/ {stackId}/ services/ {serviceId}/ actions/ start/ - GET
/
to access the STDOUT stream of a service in a container stackv2/ stacks/ {stackId}/ services/ {serviceId}/ logs/