Docker 1.13 was released yesterday, congratulations!

Docker 1.13

A quick summary of the key features:

  • Compose file to deploy Swarm mode services
  • Improved CLI backwards compatibility
  • Clean-up commands
  • CLI restructured
  • Monitoring and Build improvements

Learn more details about these features in this video by @manomarks:

Getting Started with Docker 1.13

Use Docker for Mac or Windows to get started. Once installed, the version information looks like:

Problems with Docker CLI

Docker 1.12 CLI has about ~40 top-level solo commands. While these commands wokred very well but they had a few issues:

  1. The commands are listed in one list without any organization. That makes it difficult for newbies to get started and learn the commands. (#8756)
  2. The command, such as docker inspect, also does not provide enough context whether they are operating on image or container. This mixing of image and container commands can cause confusion. (#13509)
  3. There is no consistency of command names. For example docker images is a plural and gives the list of images where as docker ps is singular and gives the list of containers. And they of course have the naming inconsistency issue. (#8829)
  4. Some of the commands like build and run are used heavily and then some arcane ones like pause and wait not so often. It does not seem fair to keep all the commands at the same level.

Docker 1.13 fixes this problem!

Docker Management Commands

Docker 1.13 groups the commands logically into management commands. Here are the top-level solo commands now:

Now a list of images is obtained using docker image ls command instead of docker images command. Similar docker container ls shows the list of containers instead of docker ls. This brings a lot of consistency across the commands and that would make it intuitive and easier for newbie and pros to remember the commands. Each management command has some similar set of sub-commands where they perform the operation on the command category:

Sub-commandPurpose
lsList (image, container, volume, secret, etc)
rmRemove
inspectInspect

And there are other sub-commands based upon the management category. Some of the heavily used commands are still at the top level. By default, all the top-level commands are also shown. But you can set the DOCKER_HIDE_LEGACY_COMMANDS environment variable to show only the management commands. So even though docker --help will show all the solo and management commands. But the following commands will only show the new management commands:

The old syntax is still supported but it recommended to start moving to new commands. A new Couchbase container can be started as:

The list of images can be seen as:

Mapping Docker Solo to Management Commands

Let's look at how the existing top-level commands match to the management commands:

1.121.13Purpose
attachcontainer attachAttach to a running container
buildimage buildBuild an image from a Dockerfile
commitcontainer commitCreate a new image from a container's changes
cpcontainer cpCopy files/folders between a container and the local filesystem
createcontainer createCreate a new container
diffcontainer diffInspect changes on a container's filesystem
eventssystem eventsGet real time events from the server
execcontainer execRun a command in a running container
exportcontainer exportExport a container's filesystem as a tar archive
historyimage historyShow the history of an image
imagesimage lsList images
importimage importImport the contents from a tarball to create a filesystem image
infosystem infoDisplay system-wide information
inspectcontainer inspectReturn low-level information on a container, image or task
killcontainer killKill one or more running containers
loadimage loadLoad an image from a tar archive or STDIN
loginloginLog in to a Docker registry.
logoutlogoutLog out from a Docker registry.
logscontainer logsFetch the logs of a container
networknetworkManage Docker networks
nodenodeManage Docker Swarm nodes
pausecontainer pausePause all processes within one or more containers
portcontainer portList port mappings or a specific mapping for the container
pscontainer lsList containers
pullimage pullPull an image or a repository from a registry
pushimage pushPush an image or a repository to a registry
renamecontainer renameRename a container
restartcontainer restartRestart a container
rmcontainer rmRemove one or more containers
rmiimage rmRemove one or more images
runcontainer runRun a command in a new container
saveimage saveSave one or more images to a tar archive (streamed to STDOUT by default)
searchsearchSearch the Docker Hub for images
serviceserviceManage Docker services
startcontainer startStart one or more stopped containers
statscontainer statsDisplay a live stream of container(s) resource usage statistics
stopcontainer stopStop one or more running containers
swarmswarmManage Docker Swarm
tagimage tagTag an image into a repository
topcontainer topDisplay the running processes of a container
unpausecontainer unpauseUnpause all processes within one or more containers
updatecontainer updateUpdate configuration of one or more containers
versionversionShow the Docker version information
volumevolumeManage Docker volumes
waitcontainer waitBlock until a container stops, then print its exit code

Sign up for Docker Online Meetup on 1/25 at 10am PST for more details on Docker 1.13.

Use Docker for Mac or Windows to get started with Docker 1.13.

And of course, you can learn more about how to run Couchbase on Containers.

Posted by Arun Gupta, VP, Developer Advocacy, Couchbase

Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team.Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.

Leave a reply