Skip to main content

Get a ContainerImageConfig

GET/v2/container-image-config
API version
v2
Request method
GET
Operation ID
container-get-container-image-config

Resolves the given image reference and returns the configuration of the image. An image that does not exist, cannot be accessed (e.g. a private image without matching Registry credentials), or cannot be resolved returns 400 with a validation error describing the cause; 404 is only returned for an unknown Registry passed as useCredentialsForRegistryId. If the image's registry rate-limits the request, 429 is returned and the request can be retried later.

Request​

Responses​

Format
application/json
Description

OK

  • commandarray of string

    Command of the container image.

    • Array[
      • *string
      ]
  • digeststringrequired

    The image digest.

  • entrypointarray of string

    Entrypoint of the container image.

    • Array[
      • *string
      ]
  • envarray of object

    List of environment variables the container image has.

    • Array[
      • *object
        • descriptionstring

          The description of the env key.

        • isAiGeneratedbooleanrequired

          Whether the env has been ai generated.

        • isSensitiveboolean

          Whether the env key is a sensitive field, e.g. password fields.

        • keystringrequired

          The env key.

        • valuestring

          The env default value.

      ]
  • exposedPortsarray of object

    List of exposed ports the container image has.

    • Array[
      • *object
        • descriptionstring

          The description of the exposed port.

        • isAiGeneratedbooleanrequired

          Whether the port has been ai generated.

        • portstringrequired

          The exposed port.

      ]
  • hasAiGeneratedDatabooleanrequired

    Whether the image config has ai generated data.

  • isAiAvailablebooleanrequired

    Whether ai generation is available for the image reference.

  • isUserRootbooleanrequired

    Whether the container user is root.

  • overwritingUserintegerdeprecated

    Deprecated, user will never be overwritten.

  • userstringrequired

    The user the container image is running with.

  • userIdintegerrequired

    The user id the container image is running with.

  • volumesarray of object

    List of volumes the container image has.

    • Array[
      • *object
        • descriptionstring

          The description of the volume path.

        • isAiGeneratedbooleanrequired

          Whether the volume has been ai generated.

        • volumestringrequired

          The volume path.

      ]
Content-Type: application/json

{
"command": [
"mysqld"
],
"digest": "sha256:216aab5860821ba2eecad636722a6891e40a81791fbb61e2bd49bfc5aeeacdca",
"entrypoint": [
"docker-entrypoint.sh"
],
"env": [
{
"description": "The mysql user password.",
"isAiGenerated": true,
"isSensitive": true,
"key": "MYSQL_PASSWORD",
"value": "my_password"
}
],
"exposedPorts": [
{
"description": "The mysql connection port.",
"isAiGenerated": true,
"port": "3306/tcp"
}
],
"hasAiGeneratedData": true,
"isAiAvailable": true,
"isUserRoot": true,
"user": "mysql",
"userId": 123,
"volumes": [
{
"description": "The mysql database files.",
"isAiGenerated": true,
"volume": "/var/lib/mysql"
}
]
}
{
"properties": {
"command": {
"description": "Command of the container image.",
"items": {
"example": "mysqld",
"type": "string"
},
"type": "array"
},
"digest": {
"description": "The image digest.",
"example": "sha256:216aab5860821ba2eecad636722a6891e40a81791fbb61e2bd49bfc5aeeacdca",
"type": "string"
},
"entrypoint": {
"description": "Entrypoint of the container image.",
"items": {
"example": "docker-entrypoint.sh",
"type": "string"
},
"type": "array"
},
"env": {
"description": "List of environment variables the container image has.",
"items": {
"properties": {
"description": {
"description": "The description of the env key.",
"example": "The mysql user password.",
"type": "string"
},
"isAiGenerated": {
"description": "Whether the env has been ai generated.",
"example": true,
"type": "boolean"
},
"isSensitive": {
"description": "Whether the env key is a sensitive field, e.g. password fields.",
"example": true,
"type": "boolean"
},
"key": {
"description": "The env key.",
"example": "MYSQL_PASSWORD",
"type": "string"
},
"value": {
"description": "The env default value.",
"example": "my_password",
"type": "string"
}
},
"required": [
"key",
"isAiGenerated"
],
"type": "object"
},
"type": "array"
},
"exposedPorts": {
"description": "List of exposed ports the container image has.",
"items": {
"properties": {
"description": {
"description": "The description of the exposed port.",
"example": "The mysql connection port.",
"type": "string"
},
"isAiGenerated": {
"description": "Whether the port has been ai generated.",
"example": true,
"type": "boolean"
},
"port": {
"description": "The exposed port.",
"example": "3306/tcp",
"type": "string"
}
},
"required": [
"port",
"isAiGenerated"
],
"type": "object"
},
"type": "array"
},
"hasAiGeneratedData": {
"description": "Whether the image config has ai generated data.",
"example": true,
"type": "boolean"
},
"isAiAvailable": {
"description": "Whether ai generation is available for the image reference.",
"example": true,
"type": "boolean"
},
"isUserRoot": {
"description": "Whether the container user is root.",
"example": false,
"type": "boolean"
},
"overwritingUser": {
"deprecated": true,
"description": "Deprecated, user will never be overwritten.",
"example": 1000,
"type": "integer"
},
"user": {
"description": "The user the container image is running with.",
"example": "mysql",
"type": "string"
},
"userId": {
"description": "The user id the container image is running with.",
"example": 0,
"type": "integer"
},
"volumes": {
"description": "List of volumes the container image has.",
"items": {
"properties": {
"description": {
"description": "The description of the volume path.",
"example": "The mysql database files.",
"type": "string"
},
"isAiGenerated": {
"description": "Whether the volume has been ai generated.",
"example": true,
"type": "boolean"
},
"volume": {
"description": "The volume path.",
"example": "/var/lib/mysql",
"type": "string"
}
},
"required": [
"volume",
"isAiGenerated"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"user",
"userId",
"isUserRoot",
"hasAiGeneratedData",
"isAiAvailable",
"digest"
],
"type": "object"
}

Usage examples​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/container-image-config?imageReference=mysql&useCredentialsForProjectId=f0f86186-0a5a-45b2-aa33-502777496347&useCredentialsForRegistryId=f0f86186-0a5a-45b2-aa33-502777496347&generateAiData=true
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.container.getContainerImageConfig({
"queryParameters": {
"imageReference": "mysql",
"useCredentialsForProjectId": "f0f86186-0a5a-45b2-aa33-502777496347",
"useCredentialsForRegistryId": "f0f86186-0a5a-45b2-aa33-502777496347",
"generateAiData": true
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Container\GetContainerImageConfig\GetContainerImageConfigRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new GetContainerImageConfigRequest())
->withImageReference("mysql")
->withUseCredentialsForProjectId("f0f86186-0a5a-45b2-aa33-502777496347")
->withUseCredentialsForRegistryId("f0f86186-0a5a-45b2-aa33-502777496347")
->withGenerateAiData(true);
$response = $client->container()->getContainerImageConfig($request);

var_dump($response->getBody();

On this page