If you work with Docker a lot, you might have noticed that the list of containers tends to grow out of control over time. Now and then you bump into an abandoned dusty container somewhere in the dark corner of your
So I’ve created a tiny so-called application indicator for Ubuntu/Unity to simplify managing my container collection. Please welcome the Docker Indicator!
What is implemented so far
This is just an early beta that can still prove useful:
- The menu displays a live list of available containers (both running and stopped). The list is updated automatically thanks to Docker daemon event subscription.
- A container can be started or stopped by selecting the corresponding menu item.
- Whenever a container is started or stopped (not necessarily via the indicator), a desktop notification is shown.
Here’s how it looks like:
This indicator is written on Python 3, just like the my other app, the Sound Switcher Indicator.
Prerequisite: you need to manually install Docker Python API—unfortunately the version available in Ubuntu’s repos is fairly outdated. Installation in Ubuntu is pretty straightforward:
sudo pip3 install docker
The indicator can then be installed from my PPA:
sudo apt-add-repository ppa:yktooo/ppa sudo apt update sudo apt install indicator-docker
At this moment builds are available for Ubuntu 16.10 Yakkety Yak and Ubuntu 17.04 Zesty Zapus. The application is started automatically after login.
By the way, once I’ve started digging into the subject, I figured out that Docker has a great, fully documented Python API, and also that the daemon is interacted with via REST calls to its web server. These calls can be monitored if you start the indicator with the
-vv option. This is so awesome!
Bug reports are welcome at the GitHub issue tracker. Please make sure you attach the console output provided by running:
The complete source code is available in my GitHub repository.
- Make a custom build of
python3-dockerso that you don’t have to manually run
- Add settings file.
- Add container remove function.
- Add Docker image management.
- … and lots of other stuff.
On a side note, the recent announcement by Canonical that Unity will soon be discontinued makes the future of app indicators a bit uncertain…