BLOG(6)BLOG MANUALBLOG(6)
NAME How can you organize your docker containers? DESCRIPTION

The moment you cross over the mental threshold from using docker for local development/experimentation to using docker as a host for important things, you'll begin to have questions. One of the early questions I had was, "How can I organize all these containers when all $ docker ps -a gives me is "NAMES"? The answer to that question is Labels!


Image source: http://imagegenerator.fuzzimo.com/embossedlabels/

You can assign labels to images within Dockerfiles or to containers with the $ docker run and $ docker daemon commands.

You can query for images with $ docker images --filter "label=color=blue", containers with $ docker ps --filter "label=color=blue" or via $ docker inspect

Docker treats the labels as simple strings, but if you want to get fancy you can store string-escaped JSON data if you want to write your own label parser.

SEE ALSO      appletonmakerspace(1), github(1), instagram(6), mastodon(6), wisconsinlinux(1), youtube(6) AUTHORS Mike Putnam mike@theputnams.net FILES2023-12-09-100-hours-1000-kilometers2017-07-06-whats-going-on-in-tech2017-04-26-git-blame2016-10-27-choose-your-own-adventure-lockin2016-09-23-the-zen-of-python2016-07-18-organize-your-docker-stuff-with-labels2016-02-15-tail-foreverjs-logs2015-06-30-coder-cooperative2014-09-28-learning-to-weld2014-05-04-a-copper-thing2014-05-01-openbsd-55-released-today2014-04-30-what-to-make2013-10-10-appleton-makerspace-grand-opening2012-11-11-dell-xps-13-ultrabook-running-openbsd-snapshot2011-09-28-why-i-love-barcamp2011-07-04-a-simple-python-grep2011-05-08-dhmn-candybot-won2011-04-14-milwaukee-makerspace-grand-opening-road-trip2011-03-17-what-the-heck-is-a-barcamp2011-02-21-arduino-mosfet-irobot-wheels2011-02-05-dhmn-make-session2011-02-01-gladiator-girl2011-01-31-toward-an-appleton-wi-makerspace2011-01-24-madhackerhaus-12011-01-16-a-timelapse-doodle2010-11-07-arduino-happy-birthday-emitter2002-07-08-self-hosted-linux2002-04-08-geocaching More posts... (press for help or to quit)
BLOG(6)BLOG MANUALBLOG(6)
Mike Putnam