2018-03-20 17:41:19 +08:00
# buildah-rmi "1" "March 2017" "buildah"
2017-03-29 03:37:24 +08:00
## NAME
2021-06-17 02:21:48 +08:00
2018-04-26 21:01:15 +08:00
buildah\-rmi - Removes one or more images.
2017-03-29 03:37:24 +08:00
## SYNOPSIS
2021-06-17 02:21:48 +08:00
2018-09-30 01:21:22 +08:00
**buildah rmi** [*image* ...]
2017-03-29 03:37:24 +08:00
## DESCRIPTION
2021-06-17 02:21:48 +08:00
2017-04-14 03:42:04 +08:00
Removes one or more locally stored images.
2021-06-17 02:21:48 +08:00
Passing an argument _image_ deletes it, along with any of its dangling (untagged) parent images.
2017-03-29 03:37:24 +08:00
2018-02-10 04:48:52 +08:00
## LIMITATIONS
2021-06-17 02:21:48 +08:00
2021-09-01 22:50:23 +08:00
* If the image was pushed to a directory path using the 'dir:' transport,
the rmi command can not remove the image. Instead, standard file system
commands should be used.
* If _imageID_ is a name, but does not include a registry name, buildah will
attempt to find and remove the named image using the registry name _localhost_ ,
if no such image is found, it will search for the intended image by attempting
to expand the given name using the names of registries provided in the system's
registries configuration file, registries.conf.
* If the _imageID_ refers to a *manifest list* or *image index* , this command
will ** *not*** do what you expect! This command will remove the images
associated with the *manifest list* or *index* (not the manifest list/image index
itself). To remove that, use the `buildah manifest rm` subcommand instead.
2018-02-10 04:48:52 +08:00
2017-06-21 22:54:43 +08:00
## OPTIONS
New CI check: xref --help vs man pages
Run 'buildah --help', recursively against all subcommands,
then cross-reference the results against docs/buildah*.md.
Report differences in subcommands and/or flags.
The majority of the changes in this PR are trivial (see
below) but a handful may be controversial and require
careful review:
* Making 'bud' the default output of 'buildah help',
with 'build-using-dockerfile' as an alias. This is
the inverse of the situation until now: buildah
would list build-using-dockerfile as the primary
name. The man page, OTOH, lists 'bud'. The source
file name is 'bud'. I suspect that most people
type 'bud'. So, for consistency, I choose to make
'bud' the default visible command.
* add --encryption-key and --encrypt-layer documentation
to buildah-commit.md, and --encrypt-layer to -push.md.
Please double-check the wording here.
* remove --notruncate from buildah-images.md. The option
does not exist (although there is a TODO comment in
the code). If it should exist, it is left to the
reader to implement. I would humbly suggest that this
is a good idea, for consistency with buildah containers.
* remove --shm-size from buildah-pull.md. The option
does not exist, and I suspect this was a copy-paste error.
* remove --security-opt from run.go. It was unimplemented
and undocumented.
* remove --userns-[gu]id-map from buildah-bud.md. These
are global options, not bud options, and are documented
well enough in buildah.bud.
Trivial (IMO) changes:
* split options in man pages, from '**--foo, -f**'
to '**--foo**, **-f**'. This conforms with the style
used in podman man pages.
* add missing one-letter aliases (usually "-q", "-a")
* add missing man page entries for some easy options
* sort out-of-order subcommand listings in man pages
Finally, do note that this is a copy-and-alter duplicate of the
original script in podman, and that is horrible. In an ideal
world I would've been able to refactor the podman version into
something usable on both repos (and then more). It turns out the
differences in man page format and in special-case handling are
too broad to let me do a clean refactor.
Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-21 22:51:19 +08:00
**--all**, ** -a**
2018-01-06 08:20:26 +08:00
All local images will be removed from the system that do not have containers using the image as a reference image.
2021-06-17 02:21:48 +08:00
An image name or id cannot be provided when this option is used. Read/Only images configured by modifying the "additionalimagestores" in the /etc/containers/storage.conf file, can not be removed.
2018-01-06 08:20:26 +08:00
2022-03-24 20:03:06 +08:00
**--force**, ** -f**
This option will cause Buildah to remove all containers that are using the image before removing the image from the system.
New CI check: xref --help vs man pages
Run 'buildah --help', recursively against all subcommands,
then cross-reference the results against docs/buildah*.md.
Report differences in subcommands and/or flags.
The majority of the changes in this PR are trivial (see
below) but a handful may be controversial and require
careful review:
* Making 'bud' the default output of 'buildah help',
with 'build-using-dockerfile' as an alias. This is
the inverse of the situation until now: buildah
would list build-using-dockerfile as the primary
name. The man page, OTOH, lists 'bud'. The source
file name is 'bud'. I suspect that most people
type 'bud'. So, for consistency, I choose to make
'bud' the default visible command.
* add --encryption-key and --encrypt-layer documentation
to buildah-commit.md, and --encrypt-layer to -push.md.
Please double-check the wording here.
* remove --notruncate from buildah-images.md. The option
does not exist (although there is a TODO comment in
the code). If it should exist, it is left to the
reader to implement. I would humbly suggest that this
is a good idea, for consistency with buildah containers.
* remove --shm-size from buildah-pull.md. The option
does not exist, and I suspect this was a copy-paste error.
* remove --security-opt from run.go. It was unimplemented
and undocumented.
* remove --userns-[gu]id-map from buildah-bud.md. These
are global options, not bud options, and are documented
well enough in buildah.bud.
Trivial (IMO) changes:
* split options in man pages, from '**--foo, -f**'
to '**--foo**, **-f**'. This conforms with the style
used in podman man pages.
* add missing one-letter aliases (usually "-q", "-a")
* add missing man page entries for some easy options
* sort out-of-order subcommand listings in man pages
Finally, do note that this is a copy-and-alter duplicate of the
original script in podman, and that is horrible. In an ideal
world I would've been able to refactor the podman version into
something usable on both repos (and then more). It turns out the
differences in man page format and in special-case handling are
too broad to let me do a clean refactor.
Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-21 22:51:19 +08:00
**--prune**, ** -p**
2018-01-28 05:54:38 +08:00
All local images will be removed from the system that do not have a tag and do not have a child image pointing to them.
2018-09-27 01:14:54 +08:00
An image name or id cannot be provided when this option is used.
2018-01-28 05:54:38 +08:00
2017-03-29 03:37:24 +08:00
## EXAMPLE
2017-04-14 03:42:04 +08:00
buildah rmi imageID
2018-01-06 08:20:26 +08:00
buildah rmi --all
buildah rmi --all --force
2018-01-28 05:54:38 +08:00
buildah rmi --prune
2017-06-21 22:54:43 +08:00
buildah rmi --force imageID
2017-04-14 03:42:04 +08:00
buildah rmi imageID1 imageID2 imageID3
2017-03-29 03:37:24 +08:00
2018-06-10 02:41:46 +08:00
## Files
**registries.conf** (`/etc/containers/registries.conf`)
2018-06-11 21:57:45 +08:00
registries.conf is the configuration file which specifies which container registries should be consulted when completing image names which do not include a registry or domain portion.
2018-06-10 02:41:46 +08:00
2019-07-19 17:43:03 +08:00
**storage.conf** (`/etc/containers/storage.conf`)
storage.conf is the storage configuration file for all tools using containers/storage
The storage configuration file specifies all of the available container storage options for tools using shared container storage.
2017-03-29 03:37:24 +08:00
## SEE ALSO
2021-06-17 02:21:48 +08:00
2020-01-08 01:23:23 +08:00
buildah(1), containers-registries.conf(5), containers-storage.conf(5)