gcloud_beta_container_images_delete (1)
NAME
- gcloud beta container images delete - delete existing images
SYNOPSIS
-
gcloud beta container images delete IMAGE_NAME [IMAGE_NAME ...] [--force-delete-tags] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(BETA) The container images delete command deletes the specified image
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
-
- --force-delete-tags
-
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: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
EXAMPLES
Deletes the image as long as there aren't additional, unspecified tags referencing it:
- $ gcloud beta container images delete <IMAGE_NAME>
Deletes the image (and tags) from the input IMAGE_NAME:
-
$ gcloud beta container images delete <IMAGE_NAME> \
--force-delete-tags
Deletes the image (and tags) from the input IMAGE_NAME, without additional prompting:
-
$ gcloud beta 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 beta container images delete \
--quiet [HOSTNAME]/[PROJECT-ID]/[IMAGE]@DIGEST
NOTES
This command is currently in BETA and may change without notice. These variants are also available:
- $ gcloud container images delete $ gcloud alpha container images delete