Skip to main content
PUT
Edit container

Authorizations

Authorization
string
header
required

JWT tokens should be used with OIDC account (human to machine). JWT tokens used by the Qovery console to communicate with the API have a TTL. Curl Example ' curl https://console.qovery.com/organization -H "Authorization: Bearer $qovery_token" '

Path Parameters

containerId
string<uuid>
required

Container ID

Body

application/json
name
string
required

name is case insensitive

healthchecks
object
required
storage
object[]
ports
object[]
description
string

give a description to this container

registry_id
string

id of the linked registry. Required on create unless source is sent. See source for the rules on update.

image_name
string

The image name pattern differs according to chosen container registry provider:

  • ECR: repository
  • SCALEWAY_CR: namespace/image
  • DOCKER_HUB: image or repository/image
  • PUBLIC_ECR: registry_alias/repository

Required on create unless source is sent. See source for the rules on update.

tag
string

tag of the image container. Required on create unless source is sent. See source for the rules on update.

source
object

Where the container image comes from. Send exactly one of image or git_repository; both, or neither, returns 400. A null image or git_repository counts as not sent.

  • image: an image from a container registry, like the flat registry_id, image_name and tag fields.
  • git_repository: a Git repository with a Dockerfile. Qovery builds the image from the deployed commit. Accepted on create (POST /environment/{environmentId}/container) and on update (PUT /container/{containerId}). Building from Git needs Qovery engine v1.417.0 or later on the cluster: on an older engine, the deployment fails.

Switching the source keeps the same container: its id, Kubernetes names, volumes and built-in variables. The switch does not deploy; the next deployment uses the new source.

A container with a Git repository source has three more built-in variables. <ID> is the identifier its other built-in variables use, as in QOVERY_CONTAINER_<ID>_HOST_INTERNAL:

  • QOVERY_CONTAINER_<ID>_GIT_COMMIT_ID: the deployed commit;
  • QOVERY_CONTAINER_<ID>_GIT_BRANCH: the branch configured on the source;
  • QOVERY_CONTAINER_<ID>_GIT_REPOSITORY_URL: the repository URL, without credentials, query or fragment.

They are added when missing, when the container is created from, or switched to, a Git repository. A switch back to an image keeps them, with empty values.

Rules:

  • On update (PUT /container/{containerId}), source is ignored when it repeats the stored source, and the flat registry_id, image_name and tag fields are ignored when every one sent equals the image the container runs (the registry.id, image_name and tag that GET returns). A body built from the GET response is accepted as is; only the side the client changed is applied.
  • On update, source and the flat fields both asking for a change returns 400, unless both name the same image. This includes a source.git_repository change sent with changed flat fields. On create, sending source together with the flat fields still returns 400.
  • On update of a container with an image source, source.image.registry_id may be omitted: the stored registry is kept. Switching a container with a Git repository source back to an image, and create, require it.
  • When source is not sent, the stored source is kept. Flat fields never switch the source.
  • On a container with a Git repository source, flat fields equal to the registry.id, image_name and tag that GET returns are accepted and change nothing; different values return 400 unless source.image asks for the same image. A deployment that finishes between the GET and the PUT changes these values: get the container again and retry. Send source.image to switch back to an image.
  • auto_deploy and auto_preview are accepted with a git_repository source. When not sent, they are set to false on a create from, or a switch to, git_repository, and keep their stored values on an update that keeps git_repository. A switch from git_repository to an image without auto_preview sets it to false.
  • With auto_deploy true, a push to the source branch deploys the container: anyone who can push to that branch can deploy it. Deployment restrictions (/service/{serviceId}/deploymentRestriction) limit which changed paths trigger it.
  • With auto_preview true, a pull request starts a preview environment that builds the pull request's code, pull requests from forks included, and runs it with the environment's variables and secrets. Later pushes to the pull request redeploy the preview's copy of the container only when that copy has auto_deploy true, as for applications.
arguments
string[]
entrypoint
string

optional entrypoint when launching container

cpu
integer
default:500

unit is millicores (m). 1000m = 1 cpu

Example:

1250

memory
integer
default:512

unit is MB. 1024 MB = 1GB

Example:

1024

gpu
integer
default:0
Required range: x >= 0
Example:

1

ephemeral_storage_in_gib
integer

Ephemeral storage of the service in GiB. When omitted, the platform default is used.

Required range: x >= 0
Example:

10

cpu_architecture
enum<string> | null

CPU architecture to run this service on. If null, the cluster default architecture is used.

Available options:
AMD64,
ARM64
min_running_instances
integer
default:1

Minimum number of instances running. This resource auto-scale based on the CPU and Memory consumption. Note: 0 means that there is no container running.

Required range: x >= 0
max_running_instances
integer
default:1

Maximum number of instances running. This resource auto-scale based on the CPU and Memory consumption. Note: -1 means that there is no limit.

auto_preview
boolean

Indicates if the 'environment preview option' is enabled for this container.
If enabled, a preview environment will be automatically cloned when /preview endpoint is called.
If not specified, it takes the value of the auto_preview property from the associated environment.

On a container with a Git repository source, true makes a pull request start a preview environment that builds the pull request's code, pull requests from forks included, and runs it with the environment's variables and secrets. When not specified: false on a create from, or a switch to, git_repository; the stored value on an update that keeps git_repository; false on a switch from git_repository to an image.

auto_deploy
boolean | null

Specify if the container will be automatically updated after receiving a new image tag. The new image tag shall be communicated via the "Auto Deploy container" endpoint https://api-doc.qovery.com/#tag/Containers/operation/autoDeployContainerEnvironments

On a container with a Git repository source, true makes a push to the source branch deploy the container: anyone who can push to that branch can deploy it. On a preview's copy of the container, true makes later pushes to the pull request redeploy it, as for applications. When not specified: false on a create from, or a switch to, git_repository; the stored value on an update that keeps git_repository.

annotations_groups
object[]
labels_groups
object[]
icon_uri
string<uri>

Icon URI representing the container.

autoscaling
AutoscalingPolicyRequest · object
build_settings
object

Build settings of a container with a Git repository source (source.git_repository). They apply only to the build of its image.

  • When sent, it replaces all stored values: omitted properties take their defaults, they are not merged.
  • On update, when not sent, the stored values are kept.
  • On a create from, or a switch to, git_repository without it, the defaults of a new application are used.
  • Sending it when the container is created with, keeps, or switches to, an image source returns 400.

Response

Edit container

registry, image_name and tag always hold the image this container runs:

  • with an image source, the configured image;
  • with a Git repository source, the image last deployed. Until the first successful deployment from Git, this is the image from before the switch to Git; a container created from Git has none yet, so it reports the cluster's build registry, the repository name and the tag pending-first-build. After it, this is the built image in the cluster's registry, with its build tag.

source says where the image comes from.

id
string<uuid>
required
read-only
created_at
string<date-time>
required
read-only
image_name
string
required

The image name pattern differs according to chosen container registry provider:

  • ECR: repository
  • SCALEWAY_CR: namespace/image
  • DOCKER_HUB: image or repository/image
  • PUBLIC_ECR: registry_alias/repository
tag
string
required

tag of the image container

registry
object
required
environment
object
required
maximum_cpu
integer
required

Maximum cpu that can be allocated to the container based on organization cluster configuration. unit is millicores (m). 1000m = 1 cpu

Example:

16000

maximum_memory
integer
required

Maximum memory that can be allocated to the container based on organization cluster configuration. unit is MB. 1024 MB = 1GB

Example:

16384

maximum_gpu
integer
default:0
required

Maximum memory that can be allocated to the container based on organization cluster configuration. unit is MB. 1024 MB = 1GB

Required range: x >= 0
Example:

2

name
string
required

name is case insensitive

cpu
integer
required

unit is millicores (m). 1000m = 1 cpu

Example:

1250

memory
integer
required

unit is MB. 1024 MB = 1GB

Example:

1024

gpu
integer
default:0
required
Required range: x >= 0
Example:

1

min_running_instances
integer
default:1
required

Minimum number of instances running. This resource auto-scale based on the CPU and Memory consumption. Note: 0 means that there is no container running.

Required range: x >= 0
max_running_instances
integer
default:1
required

Maximum number of instances running. This resource auto-scale based on the CPU and Memory consumption. Note: -1 means that there is no limit.

healthchecks
object
required
auto_preview
boolean
required

Indicates if the 'environment preview option' is enabled for this container.
If enabled, a preview environment will be automatically cloned when /preview endpoint is called.
If not specified, it takes the value of the auto_preview property from the associated environment.

icon_uri
string<uri>
required

Icon URI representing the container.

service_type
enum<string>
required

type of the service (application, database, job, ...)

Available options:
APPLICATION,
DATABASE,
CONTAINER,
JOB,
HELM,
TERRAFORM,
ARGOCD_APP,
AGENTIC_WORKFLOW
updated_at
string<date-time>
read-only
storage
object[]
description
string

give a description to this container

arguments
string[]
entrypoint
string

optional entrypoint when launching container

ephemeral_storage_in_gib
integer

Ephemeral storage of the service in GiB. When omitted, the platform default is used.

Required range: x >= 0
Example:

10

cpu_architecture
enum<string> | null

CPU architecture this service runs on. If null, the cluster default architecture is used.

Available options:
AMD64,
ARM64
ports
object[]
auto_deploy
boolean

Specify if the container will be automatically updated after receiving a new image tag. The new image tag shall be communicated via the "Auto Deploy container" endpoint https://api-doc.qovery.com/#tag/Containers/operation/autoDeployContainerEnvironments

annotations_groups
object[]
labels_groups
object[]
autoscaling
AutoscalingPolicyResponse · object
source
object

Where the container image comes from:

  • image: an image from a container registry;
  • git_repository: a Git repository with a Dockerfile, that Qovery builds.

Only the key of the current source is returned. The other key is omitted, never sent as null.

Always returned by API servers that support container sources; absent on older servers.

build_settings
object

Build settings of a container with a Git repository source. Absent for a container with an image source.