logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

podman-system-prune - Remove all unused pods, containers, images, networks, and volume data

Description

podmansystemprune  removes  all unused containers (both dangling and unreferenced), build containers,
       pods, networks, and optionally, volumes from local storage.

       Use the --all option to delete all unused images.  Unused images are dangling images as well as any image
       that does not have any containers based on it.

       By default, volumes are not removed to prevent important data from being deleted if there is currently no
       container using the volume. Use the --volumes flag when running the command to prune volumes as well.

       By default, build containers are not removed to prevent interference with builds  in  progress.  Use  the
       --build flag when running the command to remove build containers as well.

History

       February  2019,  Originally  compiled  by  Dan  Walsh (dwalsh at redhat dot com) December 2020, converted
       filter information from docs.docker.com documentation by Dan Walsh (dwalsh at redhat dot com)

                                                                                          podman-system-prune(1)

Name

       podman-system-prune - Remove all unused pods, containers, images, networks, and volume data

Options

--all,-a
       Recursively  remove  all  unused  pods,  containers,  images,  networks,  and  volume  data.  (Maximum 50
       iterations.)

   --build
       Removes any build containers that were created during the build, but were not removed because  the  build
       was unexpectedly terminated.

       Note:  Thisisnotsafeoperationandshouldbeexecutedonlywhennobuildsareinprogress.Itcaninterferewithbuildsinprogress.--external
       Tries to clean up remainders of previous containers or layers that are not references in the storage json
       files. These can happen in the case of unclean shutdowns or regular restarts in transient storage mode.

       However, when using transient storage mode, the Podman database does not persist. This  means  containers
       leave  the  writable  layers on disk after a reboot. When using a transient store, it is recommended that
       the podmansystemprune--external command is run during boot.

       This option is incompatible with --all and --filter and drops the default behaviour  of  removing  unused
       resources.

   --filter=filters
       Provide filter values.

       The  filters  argument  format  is  of  key=value.  If  there is more than one filter, then pass multiple
       OPTIONS: --filterfoo=bar--filterbif=baz.

       Supported filters:

       ┌────────┬───────────────────────────────────────┐
       │ FilterDescription                           │
       ├────────┼───────────────────────────────────────┤
       │ label  │ Only remove  containers  and  images, │
       │        │ with  (or  without,  in  the  case of │
       │        │ label!=[...] is used)  the  specified │
       │        │ labels.                               │
       ├────────┼───────────────────────────────────────┤
       │ until  │ Only  remove  containers  and  images │
       │        │ created before given timestamp.       │
       └────────┴───────────────────────────────────────┘

       The labelfilter accepts two formats. One is the label=key or label=key=value, which  removes  containers
       and  images  with  the  specified  labels.  The other format is the label!=key or label!=key=value, which
       removes containers and images without the specified labels.

       The untilfilter can be Unix timestamps, date formatted timestamps, or Go  duration  strings  (e.g.  10m,
       1h30m) computed relative to the machine’s time.

   --force,-f
       Do not prompt for confirmation

   --help,-h
       Print usage statement

   --volumes
       Prune volumes currently unused by any container

See Also

podman(1), podman-system(1)

Synopsis

podmansystemprune [options]

See Also