5 minutes dabbling with Docker Distributed Application Bundles (DAB)

Lachlan Evenson
2 min readJun 27, 2016

--

One of the many exciting announcements during DockerCon 2016 was the introduction of Distributed Application Bundles (DAB).

Unfortunately, I couldn’t find too much fodder other than the blog post and Github. So I set out on a quick journey of discovery.

Taken from the blog post, here is the stated purpose of DABs.

“an experimental open file format for bundling up all the artifacts required to ship and deploy multi-container apps: a DAB contains a description of all the services required to run the application and details images to use, ports to expose, and the networks used to link services.”

Why?

The typical Docker development workflow looks as follows:

  • Write application code
  • Build container
  • Test container locally
  • Ship to production environments

This works great for single-tier apps but real world applications are seldom single-tier. They are multi-tier and need networks, services and links defined, hence the need for docker-compose. DAB provide a way to package the goodness that you’ve defined in your docker-compose.yml file and deploy to any Docker Swarm Cluster.

How?

Remember, this feature is experimental at the time of writing. The great part of open source communities is that we all have the opportunity to contribute and shape the future of DABs. I encourage you to get connected if this is something you’re passionate about.

Prerequisites are:

  • Docker Compose 1.8
  • Docker Engine 1.12

Under the path of your docker-compose.yml, run the following:

docker-compose bundle

That will result in a .dsb (DAB) file being dumped in your current working directory.

The DAB file appears to be simply a JSON representation of the docker-compose.yml with some slight variances in the metadata.

We can then deploy the DAB file to any Docker Swarm Cluster using the following command:

docker deploy <DABFilename>

Note — In the current release you must remove the file extension from the name.

Want to see it in action?

Here’s a demo featuring the complete workflow to a Docker Swarm Cluster.

Source repo here

Wrap Up

Using DABs provides a consistent and cohesive development experience that users love when working with Docker tools. This eases the burden of shipping multi-tier apps from your local development environment to production ready clusters.

Cheers!

--

--

Lachlan Evenson

Husband | Father of three | Youtuber | Containers @Azure | 🇦🇺 | Time Traveller | CloudNative Ambassador + Mercenary | CKA | Opinions are my own.