ECR / Client / put_image

put_image#

ECR.Client.put_image(**kwargs)#

Creates or updates the image manifest and tags associated with an image.

When an image is pushed and all new image layers have been uploaded, the PutImage API is called once to create or update the image manifest and the tags associated with the image.

Note

This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.

See also: AWS API Documentation

Request Syntax

response = client.put_image(
    registryId='string',
    repositoryName='string',
    imageManifest='string',
    imageManifestMediaType='string',
    imageTag='string',
    imageDigest='string'
)
Parameters:
  • registryId (string) – The Amazon Web Services account ID associated with the registry that contains the repository in which to put the image. If you do not specify a registry, the default registry is assumed.

  • repositoryName (string) –

    [REQUIRED]

    The name of the repository in which to put the image.

  • imageManifest (string) –

    [REQUIRED]

    The image manifest corresponding to the image to be uploaded.

  • imageManifestMediaType (string) – The media type of the image manifest. If you push an image manifest that does not contain the mediaType field, you must specify the imageManifestMediaType in the request.

  • imageTag (string) – The tag to associate with the image. This parameter is required for images that use the Docker Image Manifest V2 Schema 2 or Open Container Initiative (OCI) formats.

  • imageDigest (string) – The image digest of the image manifest corresponding to the image.

Return type:

dict

Returns:

Response Syntax

{
    'image': {
        'registryId': 'string',
        'repositoryName': 'string',
        'imageId': {
            'imageDigest': 'string',
            'imageTag': 'string'
        },
        'imageManifest': 'string',
        'imageManifestMediaType': 'string'
    }
}

Response Structure

  • (dict) –

    • image (dict) –

      Details of the image uploaded.

      • registryId (string) –

        The Amazon Web Services account ID associated with the registry containing the image.

      • repositoryName (string) –

        The name of the repository associated with the image.

      • imageId (dict) –

        An object containing the image tag and image digest associated with an image.

        • imageDigest (string) –

          The sha256 digest of the image manifest.

        • imageTag (string) –

          The tag used for the image.

      • imageManifest (string) –

        The image manifest associated with the image.

      • imageManifestMediaType (string) –

        The manifest media type of the image.

Exceptions

  • ECR.Client.exceptions.ServerException

  • ECR.Client.exceptions.InvalidParameterException

  • ECR.Client.exceptions.RepositoryNotFoundException

  • ECR.Client.exceptions.ImageAlreadyExistsException

  • ECR.Client.exceptions.LayersNotFoundException

  • ECR.Client.exceptions.ReferencedImagesNotFoundException

  • ECR.Client.exceptions.LimitExceededException

  • ECR.Client.exceptions.ImageTagAlreadyExistsException

  • ECR.Client.exceptions.ImageDigestDoesNotMatchException

  • ECR.Client.exceptions.KmsException