Skip to content

Schedule Moby/Docker containers cleanup after specific delay

License

Notifications You must be signed in to change notification settings

reneleonhardt/moby-ryuk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moby Ryuk

This project helps you to remove containers/networks/volumes/images by given filter after specified delay.

Usage

  1. Start it:

     $ ./bin/moby-ryuk -p 8080
     $ # You can also run it with Docker
     $ docker run -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 quay.io/testcontainers/ryuk
    
  2. Connect via TCP:

     $ nc localhost 8080
    
  3. Send some filters:

     label=testing=true&health=unhealthy
     ACK
     label=something
     ACK
    
  4. Close the connection

  5. Send more filters with "one-off" style:

     printf "label=something_else" | nc localhost 8080
    
  6. See containers/networks/volumes deleted after 10s:

     2018/01/15 18:38:52 Timed out waiting for connection
     2018/01/15 18:38:52 Deleting {"label":{"something":true}}
     2018/01/15 18:38:52 Deleting {"label":{"something_else":true}}
     2018/01/15 18:38:52 Deleting {"health":{"unhealthy":true},"label":{"testing=true":true}}
     2018/01/15 18:38:52 Removed 1 container(s), 0 network(s), 0 volume(s), 0 image(s)
    

About

Schedule Moby/Docker containers cleanup after specific delay

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 83.8%
  • Makefile 10.8%
  • Dockerfile 5.4%