What's new in Docker 1.13

Docker 1.13 is out and there are some new interesting features which are really useful to DevOps as well as Application Developers.

Docker Stack

One huge feature they've rolled out is "docker stack" wherein you can configure all your services into a single configuration file. This was already there before for running containers using docker-compose. The main difference is that "docker stack" is for deployment of services to a Swarm cluster. Configuration is done in a single yaml file.

DEMO

You can use this sample yml file to try out docker stack

https://github.com/docker/example-voting-app/blob/master/docker-stack.yml

In the yaml file, you can define all the services you would like to run as well as the replica configuration you require for each service. In the same configuration, you can also define which network you would want to run the service.

alt

To run, just save the file as mystack.yml and execute this in the terminal:

$docker stack deploy -c mystack.yml mystack

After executing, you will see something like this.
alt

To check if stack is created and services are running, you can execute:

$docker stack ls and $docker service ls

alt

Networks are also automatically created if not yet existing

alt

To check if the sample application is running, you can access

http://localhost:5000

alt

http://localhost:5001

alt

You can also check the Swarm visualizer. Currently, I am using my Mac and just running a single node cluster. The visualization would be more interesting if you are running many nodes.
The visualizer in the example is running in

http://localhost:8080

alt

To remove the entire stack, it is just one command!

$docker stack rm mystack

After executing, it stops instances of all services in the stack.

alt

Cleaning up

Previously it was difficult to check how much disk space is consumed by docker. Now, there is a easier way to do it:

$docker system df
alt

$docker system prune can purge all stopped containers, volumes not used, networks not used and dangling images.

Docker Service Logs

Another interesting feature which is very useful for application developers is "docker service logs"

$docker service logs <service name>

If you noticed, the command is consolidating the logs from the 2 running containers. This is really very useful when you need to investigate an issue. You can also send logs to ElasticSearch via FileBeat and this even makes it easier!
alt

This is experimental for now but is already available in 1.13 so you can play around with it.

Grouping Commands

These commands are now available in 1.13. Docker is now grouping commands based on the object it’s interacting with.

Containers

$docker container list / $docker container start

alt

Images

$docker image history
alt

It was a very good update from Docker and we look forward to more on the next release!

Feel free to leave a comment below.