- NAME
-
- gcloud container images delete - delete existing images
- SYNOPSIS
-
-
gcloud container images delete
IMAGE_NAME
[IMAGE_NAME
…] [--force-delete-tags
] [GCLOUD_WIDE_FLAG …
]
-
- DESCRIPTION
- The container images delete command deletes the specified image from the registry. All associated tags are also deleted.
- EXAMPLES
-
Deletes the image as long as there aren't additional, unspecified tags
referencing it:
gcloud container images delete <IMAGE_NAME>
Deletes the image (and tags) from the input IMAGE_NAME:
gcloud container images delete <IMAGE_NAME> --force-delete-tags
Deletes the image (and tags) from the input IMAGE_NAME, without additional prompting:
gcloud container images delete <IMAGE_NAME> --force-delete-tags --quiet
To easily identify and delete untagged images in a project, first filter digests that lack tags:
gcloud container images list-tags [HOSTNAME]/[PROJECT-ID]/[IMAGE] --filter='-tags:*' --format="get(digest)" --limit=$BIG_NUMBER
Then, delete these tagless images without prompting by running:
gcloud container images delete [HOSTNAME]/[PROJECT-ID]/[IMAGE]@DIGEST --quiet
- POSITIONAL ARGUMENTS
-
IMAGE_NAME
[IMAGE_NAME
…]- The fully qualified name(s) of image(s) to delete. The name(s) should be formatted as *.gcr.io/PROJECT_ID/IMAGE_PATH@sha256:DIGEST or *.gcr.io/PROJECT_ID/IMAGE_PATH:TAG.
- FLAGS
-
- If there are tags pointing to an image to be deleted then they must all be specified explicitly, or this flag must be specified, for the command to succeed.
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file
,--account
,--billing-project
,--configuration
,--flags-file
,--flatten
,--format
,--help
,--impersonate-service-account
,--log-http
,--project
,--quiet
,--trace-token
,--user-output-enabled
,--verbosity
.Run
$ gcloud help
for details. - NOTES
-
These variants are also available:
gcloud alpha container images delete
gcloud beta container images delete
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-02-06 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{
"lastModified": "Last updated 2024-02-06 UTC.",
"confidential": False
}