github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/docs/source/markdown/podman-image-prune.1.md (about)

     1  % podman-image-prune(1)
     2  
     3  ## NAME
     4  podman-image-prune - Remove all unused images from the local store
     5  
     6  ## SYNOPSIS
     7  **podman image prune** [*options*]
     8  
     9  ## DESCRIPTION
    10  **podman image prune** removes all dangling images from local storage. With the `all` option,
    11  you can delete all unused images.  Unused images are dangling images as well as any image that
    12  does not have any containers based on it.
    13  
    14  The image prune command does not prune cache images that only use layers that are necessary for other images.
    15  
    16  ## OPTIONS
    17  #### **--all**, **-a**
    18  
    19  Remove dangling images and images that have no associated containers.
    20  
    21  #### **--filter**=*filters*
    22  
    23  Provide filter values.
    24  
    25  #### **--force**, **-f**
    26  
    27  Do not provide an interactive prompt for container removal.
    28  
    29  #### **--help**, **-h**
    30  
    31  Print usage statement
    32  
    33  ## EXAMPLES
    34  
    35  Remove all dangling images from local storage
    36  ```
    37  $ sudo podman image prune
    38  
    39  WARNING! This will remove all dangling images.
    40  Are you sure you want to continue? [y/N] y
    41  f3e20dc537fb04cb51672a5cb6fdf2292e61d411315549391a0d1f64e4e3097e
    42  324a7a3b2e0135f4226ffdd473e4099fd9e477a74230cdc35de69e84c0f9d907
    43  ```
    44  
    45  Remove all unused images from local storage without confirming
    46  ```
    47  $ sudo podman image prune -a -f
    48  f3e20dc537fb04cb51672a5cb6fdf2292e61d411315549391a0d1f64e4e3097e
    49  324a7a3b2e0135f4226ffdd473e4099fd9e477a74230cdc35de69e84c0f9d907
    50  6125002719feb1ddf3030acab1df6156da7ce0e78e571e9b6e9c250424d6220c
    51  91e732da5657264c6f4641b8d0c4001c218ae6c1adb9dcef33ad00cafd37d8b6
    52  e4e5109420323221f170627c138817770fb64832da7d8fe2babd863148287fca
    53  77a57fa8285e9656dbb7b23d9efa837a106957409ddd702f995605af27a45ebe
    54  
    55  ```
    56  
    57  Remove all unused images from local storage since given time/hours.
    58  ```
    59  $ sudo podman image prune -a --filter until=2019-11-14T06:15:42.937792374Z
    60  
    61  WARNING! This will remove all dangling images.
    62  Are you sure you want to continue? [y/N] y
    63  e813d2135f17fadeffeea8159a34cfdd4c30b98d8111364b913a91fd930643e9
    64  5e6572320437022e2746467ddf5b3561bf06e099e8e6361df27e0b2a7ed0b17b
    65  58fda2abf5042b35dfe04e5f8ee458a3cc26375bf309efb42c078b551a2055c7
    66  6d2bd30fe924d3414b64bd3920760617e6ced872364bc3bc6959a623252da002
    67  33d1c829be64a1e1d379caf4feec1f05a892c3ef7aa82c0be53d3c08a96c59c5
    68  f9f0a8a58c9e02a2b3250b88cc5c95b1e10245ca2c4161d19376580aaa90f55c
    69  1ef14d5ede80db78978b25ad677fd3e897a578c3af614e1fda608d40c8809707
    70  45e1482040e441a521953a6da2eca9bafc769e15667a07c23720d6e0cafc3ab2
    71  
    72  $ sudo podman image prune -f --filter until=10h
    73  f3e20dc537fb04cb51672a5cb6fdf2292e61d411315549391a0d1f64e4e3097e
    74  324a7a3b2e0135f4226ffdd473e4099fd9e477a74230cdc35de69e84c0f9d907
    75  ```
    76  
    77  Remove all unused images from local storage with label version 1.0
    78  ```
    79  $ sudo podman image prune -a -f --filter label=version=1.0
    80  e813d2135f17fadeffeea8159a34cfdd4c30b98d8111364b913a91fd930643e9
    81  5e6572320437022e2746467ddf5b3561bf06e099e8e6361df27e0b2a7ed0b17b
    82  58fda2abf5042b35dfe04e5f8ee458a3cc26375bf309efb42c078b551a2055c7
    83  6d2bd30fe924d3414b64bd3920760617e6ced872364bc3bc6959a623252da002
    84  33d1c829be64a1e1d379caf4feec1f05a892c3ef7aa82c0be53d3c08a96c59c5
    85  f9f0a8a58c9e02a2b3250b88cc5c95b1e10245ca2c4161d19376580aaa90f55c
    86  1ef14d5ede80db78978b25ad677fd3e897a578c3af614e1fda608d40c8809707
    87  45e1482040e441a521953a6da2eca9bafc769e15667a07c23720d6e0cafc3ab2
    88  
    89  ```
    90  
    91  ## SEE ALSO
    92  podman(1), podman-images
    93  
    94  ## HISTORY
    95  December 2018, Originally compiled by Brent Baude (bbaude at redhat dot com)