In the previous version of Docker Engine we added a completely new system for managing networks and volumes, and we’re pleased to announce full support for these features in Docker Compose.
Compose files used to describe just one thing: the services that make up your distributed application. We’ve now added networks and volumes to the mix, allowing you to describe much more complex applications. You can set up your app on your development machine with multiple network tiers and complex storage configurations, replicating how you might set it up in production. You can then take that same configuration from development, and use it to run your app on CI, on staging, and right through into production.
We’ve implemented this by making networks and volumes top-level objects in Compose files. Everything that used to be in a Compose file is now under a new
To get an idea of the power that this new format gives you, take a look at this example application with multiple network tiers and volumes stored in Flocker:
version: "2" services: web: image: myapp networks: - front - back redis: image: redis volumes: - redis-data:/var/lib/redis networks: - back volumes: redis-data: driver: flocker networks: front: driver: overlay back: driver: overlay
Hopefully this sparks your imagination as to what is now possible! Check out this GitHub repository for a full example that you can try out.
It’s really easy to convert your existing applications to the new format. It’s mostly a case of adding the lines
version: “2” and
services: to the top of your file, but there are a few caveats, so check out these instructions if you run into issues. If you’re not quite ready to make the jump yet, that’s fine – Compose 1.6 still works just fine with the old format.
As well as the new Compose file, there are also a couple of other new things in this release:
- Set up development environments much faster: At the same time as specifying a build directory such as
build: ./code, you can also specify an image such as
image: myusername/webapp. This means that you can use either
docker-compose buildto build the image, or make it faster by using
docker-compose pullto pull it from a registry. You can thus use pre-built images to get a development environment running faster, instead of waiting for images to build locally.
docker-compose events: A new command that streams the Engine events for your application, which can be used as a building block for tools which react to events such as containers starting and stopping.
- Build arguments: You can now pass arguments to builds from your Compose file.
Check out the release notes for a full list of what’s new. To install or upgrade Compose, the easiest way is to download Docker Toolbox.
To read more about running Compose in production, there is a guide available in the documentation.
Watch this video on the new version of Docker Compose files
Additional Resources on Docker 1.10
- Download Docker 1.10
- Read the Docker 1.10 release notes
- Register for the upcoming webinar on What’s New in Docker 1.10
- Watch this video overview on the Docker 1.10 release
- Sign up for Docker Online Meetup #32: Docker 1.10
- Watch this video on the new version of Docker Compose
- Watch this video on best practices for building secure Docker images
- Sign up for Docker Online Meetup #33: Security Enhancements in Docker Engine 1.10
Learn More about Docker
- New to Docker? Try our 10 min online tutorial
- Share images, automate builds, and more with a free Docker Hub account
- Read the Docker 1.9 Release Notes
- Subscribe to Docker Weekly
- Sign up for upcoming Docker Online Meetups
- Attend upcoming Docker Meetups
- Watch DockerCon EU 2015 videos
- Start contributing to Docker