Sign inSign up

andersjanmyr/docker-clean-host

By andersjanmyr

Updated over 10 years ago

Removes old images and containers from the host.

Image
0

673

andersjanmyr/docker-clean-host repository overview

Docker clean-host

Removes old images and containers from the host.

The container accepts an INTERVAL environment variable with the number of seconds to sleep before recurring.

Run

# Start the container with access to the docker bin and docker.sock
docker run -d \
  -v hvar/run/docker.sock:/var/run/docker.sock \
  -v $(which docker):/usr/bin/docker \
  andersjanmyr/docker-clean-host

Implementation

The commands run are:

docker rmi $(docker images -q)
docker rm -v $(docker ps -qa --no-trunc)

Tag summary

Content type

Image

Digest

Size

18.1 MB

Last updated

over 10 years ago

docker pull andersjanmyr/docker-clean-host