Skip to content

jokay/docker-prune

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker prune

Multi-platform Docker image for Docker prune.

Information

Service Stats
GitHub Last commit Issues PR
Docker Hub Pulls Stars

Usage

docker pull docker.io/xjokay/prune:latest

Supported tags

Tag Description
latest Latest release
{release} Specific release version, see available releases

Exposed Ports

None

Volumes

Directory Description
/var/run/docker.sock Needs to be mounted in order to be able to prune objects.

Configuration

ENV field Req. / Opt. Description
INTERVAL Optional Interval of pruning, default is 86400 seconds (24h).
OBJECTS Optional Objects to be pruned, default is container volume image. Additionally network can be added if desired (see samples).
OPTIONS Optional Additional options (default: none), e.g. --filter until=24h for objects created more than 1 day ago.

Samples

docker-compose

services:
  app:
    image: docker.io/xjokay/prune:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - INTERVAL=86400
      - "OBJECTS=container volume image network"
      - "OPTIONS=--filter until=24h"
    restart: always

docker run

docker run -d \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e INTERVAL=86400 \
  -e "OBJECTS=container volume image network" \
  -e "OPTIONS=--filter until=24h" \
  docker.io/xjokay/prune:latest