Skip to main content

Simple bulk operations for Docker

Project description

wrfy /wharfie/

minimal CLI tool to smooth your docker local dev experience

wrfy provides a dozen or so commands to automate common operations on a docker development or CI host. Want to pull all images? Delete images matching a regexp? Clean up dangling volumes? You've come to the right place.

installation

$ pip3 install wrfy

wrfy commands

doctor

wrfy doctor will check your docker host for common issues. The checks are:

  • containers running from an old version of the image they were launched from. for example, if you were to do docker run -it alpine:latest /bin/sh, leave that container going, and then pull a newer version of alpine:latest, wrfy will let you know that your Alpine container is running from an old image.
  • dangling volumes. dangling volumes, which are not attached to a container.
  • dangling images. dangling images, which do not have a tag.
  • stopped containers. docker hosts can build up a large number of stopped containers whose purpose was ephemeral.

Each check suggests a wrfy tool to address each particular issue identified.

kill-all

wrfy kill-all will kill all running containers. It asks for confirmation, unless --force is passed as an argument.

pull-all

wrfy pull-all will pull all images present on the docker host. This is very useful when you want to make sure everything is up to date.

rm-matching

wrfy rm-matching <pattern> will remove containers matching the provided glob pattern. If -e is passed, the pattern is interpreted as a regular expression. It asks for confirmation, unless --force is passed as an argument.

A useful command is wrfy rm-matching -e '^[a-z]+_[a-z]+$', which will remove all containers with a name comprised of two words seperated by an underscore. This will match containers with names automatically generated by docker.

rm-stopped

wrfy rm-stopped will remove all containers which are not running. It is somewhat of a blunt instrument, you might want to use rm-matching instead. It asks for confirmation, unless --force is passed as an argument.

rmi-dangling

wrfy rmi-dangling will remove all dangling images - images which haven't got a name. It asks for confirmation, unless --force is passed as an argument.

rmi-matching

wrfy rmi-matching <pattern> will remove images matching the provided glob pattern. If -e is passed, the pattern is interpreted as a regular expression. It asks for confirmation, unless --force is passed as an argument.

A useful command to clean up after docker-compose is wrfy rmi-matching -e '^[a-z]+_[a-z]+:latest$', which will remove all containers with a name comprised of two words seperated by an underscore, and a tag of latest. Such images probably came from docker-compose.

rmv-dangling

wrfy rmv-dangling will remove all dangling volumes - volumes not attached to any container. It asks for confirmation, unless --force is passed as an argument.

scrub

wrfy scrub chains together rm_stopped, rmi_dangling, and rmv_dangling. It asks for confirmation at each stage, unless --force is passed as an argument.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wrfy-0.9.1.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wrfy-0.9.1-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file wrfy-0.9.1.tar.gz.

File metadata

  • Download URL: wrfy-0.9.1.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Darwin/21.4.0

File hashes

Hashes for wrfy-0.9.1.tar.gz
Algorithm Hash digest
SHA256 77b436110e38808d38c4884964d4da4657e6f955d6265c3f8cb70b0d0ed3f4a7
MD5 a601a1618d8a4284826428a23d178a3c
BLAKE2b-256 5261ddad380957d25a34a020b161a549deb536d43be3f250c2da8b77d0c79b8d

See more details on using hashes here.

File details

Details for the file wrfy-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: wrfy-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Darwin/21.4.0

File hashes

Hashes for wrfy-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 39d8b88993293205e938cfbe2ac89adc980ad17b77fa78da7b357087332efc1b
MD5 3bb8149017e9dbc0a279463ae5273d0a
BLAKE2b-256 1def0edc1e4d3e2ffd1de535b3ba35a3b16f34e722ed0793e8a437f1e1b0b0e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page