The Docker API has allowed for a plethora of options for interfacing with Docker, your containers, and images to emerge from CLIs to desktop applications and web-based management tools. I am a fan of graphical user interfaces and thought it was time to survey the current landscape of GUIs for interacting with Docker.
I will use the WordPress Docker Compose example to test each of these options, as it has multiple containers, sets up links and networks between them, and is sufficiently complex for an example.
Kitematic is the default GUI that ships with Docker for Mac and Windows. I won’t cover it in much detail as you likely know it well already. When Kitematic first emerged, it was one of the few GUI options available, and when Docker acquired the project in October 2015, I had high hopes for its development. Sadly, it has changed little since the acquisition, and it has remained in a permanent beta.
As it’s bundled by default, it’s a great way to get started with simple Docker applications and provides a convenient way to browse images on the Docker Hub or your account. I have found it a great way to learn Docker; you can create containers visually and then dig into the possible configuration options and understand what they are and do.
Portainer (formerly UI for Docker) is a free open-source web application that runs as a container itself. You can install and start it with:
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer
-v flag isn’t mentioned by default, but you will need it to manage any local Docker containers. After creating a password and selecting the Docker instance to manage, you’re up and running.
Portainer makes wide use of the Docker API to handle its interactions and monitoring, but for automation, also exposes its own API and template file format. Portainer covers most major areas of Docker you would want to interact with, offering creation, editing, management, monitoring and deletion of containers, as well as the ability to add, remove, and view images, networks, and volumes, but not edit them.
Here’s the example application visualized in Portainer, and the overview page for the WordPress container.
Helpfully, the overview page includes basic logging and monitoring features, giving an easy overview for troubleshooting. For remote clusters, you can also jump straight into a console straight in the browser.
Portainer adds user management that lets you define the levels of access team members have to Portainer, and what aspects of Docker they can manage from within Portainer. The screenshot below shows restricting access to the Portainer container to a certain user and role.
App templates add a level on top of Dockerfiles and Compose files in a custom JSON format and allow you to create a Docker application using all the standard and custom functionality that Portainer offers. I’m not 100 percent sure how useful they are when compared to the standard Docker options, but from within the access control of Portainer, you might find them useful.
Dockstation is another "native" (well, Electron-based) application that looks a lot like Kitematic, but works from a different, "project" perspective. You first create your project and set a docker-compose.yml file or a
docker run command that starts your application.
The application is in its early days with interface quirks (e.g. after creating the project, the containers don’t actually start automatically) and lots of typos, but it has a couple of useful extra features that aren’t obvious.
Multiple Docker Clusters
If you click the pencil icon next to the current cluster address, you will notice that you can add more, making Dockstation useful for managing more than one cluster in the same interface. It also provides a search field to look for particular images or containers across all those clusters.
With a similar set of features to the other web-based GUIs mentioned in this article, Shipyard provides an interface to your containers, images, and Docker instances. Start it running with this one command that handles multiple operating systems:
curl -s https://shipyard-project.com/deploy | bash -s
Start the sample application and then click on the WordPress container. You’ll see details about the container, plus buttons to stop, start, destroy, and debug the container.
Shipyard doesn’t offer many features that make it stand out from the other web-based GUIs. Its most comprehensive standout features are the container creation screen and the ability to add private repositories. Compared to the other web-based options, it was also the easiest to start and deploy, working perfectly on Docker for Mac.
Docker Compose UI
Specifically for adding a GUI to Docker Compose, the name says it all. Once again, it runs in its own container:
docker run \ --name docker-compose-ui \ -p 5000:5000 \ -w /opt/docker-compose-projects/ \ -v /var/run/docker.sock:/var/run/docker.sock \ francescou/docker-compose-ui:1.6.0
Open your browser and you can create your own project from scratch or use one of the templates provided. To start the UI with a pre-existing docker-compose.yml file, pass in the directory containing your file or run it in the directory.
docker run \ --name docker-compose-ui \ -v $(pwd):$(pwd) \ -w $(pwd) \ -p 5000:5000 \ -v /var/run/docker.sock:/var/run/docker.sock \ francescou/docker-compose-ui:1.6.0
Not specifically for managing containers but for analyzing images, MicroBadger digs into image files to show the layers and commands within them, their dependencies, and their impact on your application.
For example, analyzing the WordPress image:
You can see that the largest dependency is for PHP, which isn’t surprising, and there’s not too much you can do about that. But it’s interesting to see the cumulative effect that every command has and where you might be able to shave off a few bytes. You can add badges to your image repositories to show potential users what the impact on their projects might be.
While the tools I’ve mentioned so far are more designed for getting started with Docker images and containers, Rancher is a tool that takes what’s possible with a Docker GUI further and is more useful for production clusters. Reflecting this focus on production, Rancher is designed to work on Linux machines, so to test locally you might need to install onto a Virtual Machine.
Start the Rancher container using the following
docker run command:
sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable
I was also able to get it running on my Mac with the instructions here, but your mileage may vary.
Using Rancher offers more than the other options here but is also far more complex. For example, Rancher supports Docker Compose but extends it with Rancher Compose to add health checks, scaling, and other features. I was able to recreate the example application using Rancher’s ‘stacks’ feature by searching for "WordPress." Within minutes, I had an active application consisting of the same parts. Throughout the interface are export options to create an appropriate YAML file for your Rancher stack.
Once you’re set up, then Rancher offers similar features to other web-based GUIs but offers interface elements to add the extra features that Rancher offers. For example, to change the number of WordPress instances, click the plus or minus icons on the container page. The normal resource constraints apply for scaling container instances, e.g. you can’t have more than one container running on a Docker host that uses the same port as another.
If you ever lose track of how the components of your stack relate to each other, then Rancher offers handy graphs to show you.
As you might have guessed, Rancher is the option on this list that adds the most unique features. For many of you, it may offer far more than you need. Other features I’ve not mentioned include hosts insights, secrets management, a wide catalog of stacks, and Docker machine drivers.
Further Into Orchestration
I intentionally kept this article about the Docker GUIs at the less complex end. However, it would be remiss of me to not mention the GUIs that ship with Docker orchestration tools such as Kubernetes and Mesos. Rancher starts to touch on their territory, but they go much further into deploying, managing, and orchestrating Docker containers in large-scale, complex applications.