Using compose files to deploy services in Swarm mode
Docker 1.13 adds support for compose files to the docker stack deploy command so that services can be deployed using the docker-compose.yml file directly. Enabling this feature is a significant effort to extend the Swarm API to make it more flexible and useful.
- the ability to specify the required number of copies for each service
- apply the update policy
- determining the conditions for launching services
Now you can deploy a complex multiservice stack on multiple hosts with just one command:
docker stack deploy –compose-file=docker-compose.yml my_stack
Improved Command Line Interface (CLI) backward compatibility
Have you ever suffered from an error called: Error response from daemon: client is newer than server because your Docker CLI version has been updated? Previously, this error was caused by the use of a new version of the client with the old version of daemon, and to avoid it, still had to use it with the old Docker engine.
As of version 1.13, newer CLIs can be used to manage older daemon versions. Also, Docker 1.13 creators have added a reconciliation feature, in case a new client tries to use features that are not supported in older daemon versions.
Docker 1.13 introduces some useful commands to help users understand how much disk space Docker is using and to help delete unused data.
docker system df- will show the space used
docker system prune – delete all unnecessary data
Prune can also be used to clean only some types of data.
Restructuring the command line interface
Over the past few years, Doker’s capabilities have been replenished with many features, with 40 teams at the time of writing this CLI article. Some, such as build or run, are most commonly used, some, such as pause or history, are less popular. Many top-level commands clutter up help pages and complicate what is known as tab-completion.
Docker 1.13 reorganized commands to make the objects they interact with more logical. For example, commands to list and start list and start containers now become the docker container subcommand and history the docker image subcommand.
docker container list
docker container start
docker image history
The changes made it possible to clean up the Docker CLI syntax, improve the help text and make it easier to use Docker. Old syntax support has been retained for backward compatibility, but the Docker team is urging everyone to adopt the new syntax.
Enhanced monitoring capabilities
docker service logs – a new powerful experimental team that greatly simplifies service debugging. Instead of manually collecting logs from separate hosts and containers, docker service logs pulls logs from all containers in which the process is running and sends them to the current console.
Docker 1.13 also added a Prometheus style collection point with basic metrics for containers, images, and daemon states.
docker build has a new experimental flag – squash. It aggregates all parts of the file system produced by compression into one consolidated layer. This can simplify the creation of minimalistic container images, but can also increase the overhead when moving images (because squash layers will no longer be able to share between images).
Version 1.13 also has support for compressing the assembly context from the CLI to daemon using the compress flag. This will accelerate the compression that is produced on remote daemons by reducing the amount of data transmitted.
As well as the beta phase of Docker’s beta testing for AWS and Azure cloud services.