Sign inSign up

skullydazed/docker-system-prune

By skullydazed

•Updated over 8 years ago

Periodically run 'docker-system-prune'

Image
0

440

skullydazed/docker-system-prune repository overview

⁠Docker System Prune

Executes the docker system prune command periodically.

⁠Usage

This image allows you to program automatically when a prune will be done on your hosts. The main advantage over external solutions like a cron job is that you can launch it in a cluster easily: "fire & forget"

Note: You need to mount the docker socket as a volume to allow the command to be executed in the host.

Unlike the upstream image⁠ this was based on, this image runs continuously. It's probably better to do it @softonic's way, but I'm one person running a very small cluster, and this is the easiest way for me to both run this and examine its logs on my rancher infrastructure.

⁠Environment variables

VariableDefault ValueDescription
DOCKER_SYSTEM_PRUNE_ARGS--forceThe arguments to pass to docker system prune
DOCKER_SYSTEM_PRUNE_SLEEP86400How long to sleep between runs

⁠Rancher

When running this service on a Rancher cluster here are a few tips:

  • Under Scale use "Always run one instance of this container on every host"
  • Under Volumes click "Add Volume" and enter /var/run/docker.sock:/var/run/docker.sock
  • Under Security/Host check "Full access to the host"

⁠Requirements

As it executes the docker system prune command this can work only in nodes with Docker versions >=1.13

Tag summary

Content type

Image

Digest

Size

35.2 MB

Last updated

over 8 years ago

docker pull skullydazed/docker-system-prune