Under Construction - Docker CLI Design

Screen Shot 2019-11-19 at 7.25.08 PM.png

Who cares about a CLI anyway?

Docker users are heavy users of the command line interface. Partly because it was, for a long time the only way to use and consume Docker, and the target audience is very comfortable with the CLI as they are heavy users of Linux. The Docker CLI was actually modeled off the Linux CLI.

The two types of CLI Models

Any CLI is roughly constructed with methods to set your focus or context and a way to manipulate objects. The order, structure and tone are where they differ.

cli_model.png

The program tells the CLI what software to use, the object is what to look for in the software and the verb is what it should do once it’s found the object. There are two different schools of thought on which model is more intuitive. Docker uses the object_verb model where others, like Kubernetes uses verb_object model. Depending what you’re familiar with one can feel more natural than the other. Each combination is generally referred to as a command.

 

Use Cases and Examples

Docker registry was introduced to allow people to manipulate the registry and the images within it. Docker Image as a command has existing for a long time, docker registry was released experimental, giving us to the time to test. We found the problem is there are different use cases but all under the same object umbrella.

registry_as_is.png

From the surface these look ok, but when you split them out by use case, you’ll that the under the same object the output of the commands output is different.

By splitting them, you can see that some are manipulating the registry itself and the other is affecting the images within the registry. This caused confusion as the intent of the command itself.

 

Remapping the commands to the correct object

By remapping the commands under the correct parent object you can maintain consistency with the expected behavior of the command.

With this new mapping we were able to maintain consistency and reduce friction for users learning these new commands.

This remapping is slatted to release in early 2020.