Bug Fixes
Fixed a bug where recreating a container multiple times would cause the new container to be started without the previous volumes.
Fixed a bug where Compose would set the value of unset environment variables to an empty string, instead of a key without a value.
Provide a better error message when Compose requires a more recent version of the Docker API.
Add a missing config field network.aliases which allows setting a network
scoped alias for a service.
Fixed a bug where run would not start services listed in depends_on.
Fixed a bug where networks and network_mode where not merged when using
extends or multiple Compose files.
Fixed a bug with service aliases where the short container id alias was only contained 10 characters, instead of the 12 characters used in previous versions.
Added a missing log message when creating a new named volume.
Fixed a bug where build.args was not merged when using extends or
multiple Compose files.
Fixed some bugs with config validation when null values or incorrect types were used instead of a mapping.
Fixed a bug where a build section without a context would show a stack
trace instead of a helpful validation message.
Improved compatibility with swarm by only setting a container affinity to the previous instance of a services' container when the service uses an anonymous container volume. Previously the affinity was always set on all containers.
Fixed the validation of some driver_opts would cause an error if a number
was used instead of a string.
Some improvements to the run.sh script used by the Compose container install
option.
Fixed a bug with up --abort-on-container-exit where Compose would exit,
but would not stop other containers.
Corrected the warning message that is printed when a boolean value is used as a value in a mapping.
Major Features:
Compose 1.6 introduces a new format for docker-compose.yml which lets
you define networks and volumes in the Compose file as well as services. It
also makes a few changes to the structure of some configuration options.
You don't have to use it - your existing Compose files will run on Compose 1.6 exactly as they do today.
Check the upgrade guide for full details: https://docs.docker.com/compose/compose-file#upgrading
Support for networking has exited experimental status and is the recommended way to enable communication between containers.
If you use the new file format, your app will use networking. If you aren't ready yet, just leave your Compose file as it is and it'll continue to work just the same.
By default, you don't have to configure any networks. In fact, using networking with Compose involves even less configuration than using links. Consult the networking guide for how to use it: https://docs.docker.com/compose/networking
The experimental flags --x-networking and --x-network-driver, introduced
in Compose 1.5, have been removed.
You can now pass arguments to a build if you're using the new file format:
build:
context: .
args:
buildno: 1
You can now specify both a build and an image key if you're using the
new file format. docker-compose build will build the image and tag it with
the name you've specified, while docker-compose pull will attempt to pull
it.
There's a new events command for monitoring container events from
the application, much like docker events. This is a good primitive for
building tools on top of Compose for performing actions when particular
things happen, such as containers starting and stopping.
There's a new depends_on option for specifying dependencies between
services. This enforces the order of startup, and ensures that when you run
docker-compose up SERVICE on a service with dependencies, those are started
as well.
New Features:
Added a new command config which validates and prints the Compose
configuration after interpolating variables, resolving relative paths, and
merging multiple files and extends.
Added a new command create for creating containers without starting them.
Added a new command down to stop and remove all the resources created by
up in a single command.
Added support for the cpu_quota configuration option.
Added support for the stop_signal configuration option.
Commands start, restart, pause, and unpause now exit with an
error status code if no containers were modified.
Added a new --abort-on-container-exit flag to up which causes up to
stop all container and exit once the first container exits.
Removed support for FIG_FILE, FIG_PROJECT_NAME, and no longer reads
fig.yml as a default Compose file location.
Removed the migrate-to-labels command.
Removed the --allow-insecure-ssl flag.
Bug Fixes:
Fixed a validation bug that prevented the use of a range of ports in
the expose field.
Fixed a validation bug that prevented the use of arrays in the entrypoint
field if they contained duplicate entries.
Fixed a bug that caused ulimits to be ignored when used with extends.
Fixed a bug that prevented ipv6 addresses in extra_hosts.
Fixed a bug that caused extends to be ignored when included from
multiple Compose files.
Fixed an incorrect warning when a container volume was defined in the Compose file.
Fixed a bug that prevented the force shutdown behaviour of up and
logs.
Fixed a bug that caused None to be printed as the network driver name
when the default network driver was used.
Fixed a bug where using the string form of dns or dns_search would
cause an error.
Fixed a bug where a container would be reported as "Up" when it was in the restarting state.
Fixed a confusing error message when DOCKER_CERT_PATH was not set properly.
Fixed a bug where attaching to a container would fail if it was using a non-standard logging driver (or none at all).
Fixed a bug which broke the use of environment and env_file with
extends, and caused environment keys without values to have a None
value, instead of a value from the host environment.
Fixed a regression in 1.5.1 that caused a warning about volumes to be raised incorrectly when containers were recreated.
Fixed a bug which prevented building a Dockerfile that used ADD <url>
Fixed a bug with docker-compose restart which prevented it from
starting stopped containers.
Fixed handling of SIGTERM and SIGINT to properly stop containers
Add support for using a url as the value of build
Improved the validation of the expose option
Add the --force-rm option to build.
Add the ulimit option for services in the Compose file.
Fixed a bug where up would error with "service needs to be built" if
a service changed from using image to using build.
Fixed a bug that would cause incorrect output of parallel operations on some terminals.
Fixed a bug that prevented a container from being recreated when the
mode of a volumes_from was changed.
Fixed a regression in 1.5.0 where non-utf-8 unicode characters would cause
up or logs to crash.
Fixed a regression in 1.5.0 where Compose would use a success exit status code when a command fails due to an HTTP timeout communicating with the docker daemon.
Fixed a regression in 1.5.0 where name was being accepted as a valid
service option which would override the actual name of the service.
When using --x-networking Compose no longer sets the hostname to the
container name.
When using --x-networking Compose will only create the default network
if at least one container is using the network.
When printings logs during up or logs, flush the output buffer after
each line to prevent buffering issues from hideing logs.
Recreate a container if one of its dependencies is being created. Previously a container was only recreated if it's dependencies already existed, but were being recreated as well.
Add a warning when a volume in the Compose file is being ignored
and masked by a container volume from a previous container.
Improve the output of pull when run without a tty.
When using multiple Compose files, validate each before attempting to merge them together. Previously invalid files would result in not helpful errors.
Allow dashes in keys in the environment service option.
Improve validation error messages by including the filename as part of the error message.
Breaking changes:
With the introduction of variable substitution support in the Compose file, any
Compose file that uses an environment variable ($VAR or ${VAR}) in the command:
or entrypoint: field will break.
Previously these values were interpolated inside the container, with a value from the container environment. In Compose 1.5.0, the values will be interpolated on the host, with a value from the host environment.
To migrate a Compose file to 1.5.0, escape the variables with an extra $
(ex: $$VAR or $${VAR}). See
https://github.com/docker/compose/blob/8cc8e61/docs/compose-file.md#variable-substitution
Major features:
Compose is now available for Windows.
Environment variables can be used in the Compose file. See https://github.com/docker/compose/blob/8cc8e61/docs/compose-file.md#variable-substitution
Multiple compose files can be specified, allowing you to override settings in the default Compose file. See https://github.com/docker/compose/blob/8cc8e61/docs/reference/docker-compose.md for more details.
Compose now produces better error messages when a file contains invalid configuration.
up now waits for all services to exit before shutting down,
rather than shutting down as soon as one container exits.
Experimental support for the new docker networking system can be
enabled with the --x-networking flag. Read more here:
https://github.com/docker/docker/blob/8fee1c20/docs/userguide/dockernetworks.md
New features:
You can now optionally pass a mode to volumes_from, e.g.
volumes_from: ["servicename:ro"].
Since Docker now lets you create volumes with names, you can refer to those
volumes by name in docker-compose.yml. For example,
volumes: ["mydatavolume:/data"] will mount the volume named
mydatavolume at the path /data inside the container.
If the first component of an entry in volumes starts with a ., / or
~, it is treated as a path and expansion of relative paths is performed as
necessary. Otherwise, it is treated as a volume name and passed straight
through to Docker.
Read more on named volumes and volume drivers here: https://github.com/docker/docker/blob/244d9c33/docs/userguide/dockervolumes.md
docker-compose build --pull instructs Compose to pull the base image for
each Dockerfile before building.
docker-compose pull --ignore-pull-failures instructs Compose to continue
if it fails to pull a single service's image, rather than aborting.
You can now specify an IPC namespace in docker-compose.yml with the ipc
option.
Containers created by docker-compose run can now be named with the
--name flag.
If you install Compose with pip or use it as a library, it now works with Python 3.
image now supports image digests (in addition to ids and tags), e.g.
image: "busybox@sha256:38a203e1986cf79639cfb9b2e1d6e773de84002feea2d4eb006b52004ee8502d"
ports now supports ranges of ports, e.g.
ports:
- "3000-3005"
- "9000-9001:8000-8001"
docker-compose run now supports a -p|--publish parameter, much like
docker run -p, for publishing specific ports to the host.
docker-compose pause and docker-compose unpause have been implemented,
analogous to docker pause and docker unpause.
When using extends to copy configuration from another service in the same
Compose file, you can omit the file option.
Compose can be installed and run as a Docker image. This is an experimental feature.
Bug fixes:
All values for the log_driver option which are supported by the Docker
daemon are now supported by Compose.
docker-compose build can now be run successfully against a Swarm cluster.
docker-compose up
without the -d option to exit immediately.The following bugs have been fixed:
links, volumes_from, and
net) were not properly triggering a container recreate as part of
docker-compose up.docker-compose up <service> was showing logs for all services instead of
just the specified services.service_number instead of their custom container name.By default, docker-compose up now only recreates containers for services whose configuration has changed since they were created. This should result in a dramatic speed-up for many applications.
The experimental --x-smart-recreate flag which introduced this feature in Compose 1.3.0 has been removed, and a --force-recreate flag has been added for when you want to recreate everything.
Several of Compose's commands - scale, stop, kill and rm - now perform actions on multiple containers in parallel, rather than in sequence, which will run much faster on larger applications.
You can now specify a custom name for a service's container with container_name. Because Docker container names must be unique, this means you can't scale the service beyond one container.
You no longer have to specify a file option when using extends - it will default to the current file.
Service names can now contain dots, dashes and underscores.
Compose can now read YAML configuration from standard input, rather than from a file, by specifying - as the filename. This makes it easier to generate configuration dynamically:
$ echo 'redis: {"image": "redis"}' | docker-compose --file - up
There's a new docker-compose version command which prints extended information about Compose's bundled dependencies.
docker-compose.yml now supports log_opt as well as log_driver, allowing you to pass extra configuration to a service's logging driver.
docker-compose.yml now supports memswap_limit, similar to docker run --memory-swap.
When mounting volumes with the volumes option, you can now pass in any mode supported by the daemon, not just :ro or :rw. For example, SELinux users can pass :z or :Z.
You can now specify a custom volume driver with the volume_driver option in docker-compose.yml, much like docker run --volume-driver.
A bug has been fixed where Compose would fail to pull images from private registries serving plain (unsecured) HTTP. The --allow-insecure-ssl flag, which was previously used to work around this issue, has been deprecated and now has no effect.
A bug has been fixed where docker-compose build would fail if the build depended on a private Hub image or an image from a private registry.
A bug has been fixed where Compose would crash if there were containers which the Docker daemon had not finished removing.
Two bugs have been fixed where Compose would sometimes fail with a "Duplicate bind mount" error, or fail to attach volumes to a container, if there was a volume path specified in docker-compose.yml with a trailing slash.
Thanks @mnowster, @dnephin, @ekristen, @funkyfuture, @jeffk and @lukemarsden!
Two regressions have been fixed:
The following bugs have been fixed:
docker-compose run on an older version of Compose, docker-compose run would fail with a name collision. Compose now shows an error if you have leftover containers of this type lying around, and tells you how to remove them.~/docker/config.json, and authentication against private registries would therefore fail.docker-compose up would be truncated.docker-compose up --x-smart-recreate would sometimes fail when an image tag was updated.docker-compose up would sometimes create two containers with the same numeric suffix.docker-compose rm and docker-compose ps would sometimes list services that aren't part of the current project (though no containers were erroneously removed).docker-compose commands would not show an error if invalid service names were passed in.Thanks @dano, @josephpage, @kevinsimper, @lieryan, @phemmer, @soulrebel and @sschepens!
The following bugs have been fixed:
docker-compose build would always attempt to pull the base image before building.docker-compose help migrate-to-labels failed with an error.Firstly, two important notes:
This release contains breaking changes, and you will need to either remove or migrate your existing containers before running your app - see the upgrading section of the install docs for details.
Compose now requires Docker 1.6.0 or later.
We've done a lot of work in this release to remove hacks and make Compose more stable:
Compose now uses container labels, rather than names, to keep track of containers. This makes Compose both faster and easier to integrate with your own tools.
Compose no longer uses "intermediate containers" when recreating containers for a service. This makes docker-compose up less complex and more resilient to failure.
There are some new features:
docker-compose up has an experimental new behaviour: it will only recreate containers for services whose configuration has changed in docker-compose.yml. This will eventually become the default, but for now you can take it for a spin:
$ docker-compose up --x-smart-recreate
When invoked in a subdirectory of a project, docker-compose will now climb up through parent directories until it finds a docker-compose.yml.
Several new configuration keys have been added to docker-compose.yml:
dockerfile, like docker build --file, lets you specify an alternate Dockerfile to use with build.labels, like docker run --labels, lets you add custom metadata to containers.extra_hosts, like docker run --add-host, lets you add entries to a container's /etc/hosts file.pid: host, like docker run --pid=host, lets you reuse the same PID namespace as the host machine.cpuset, like docker run --cpuset-cpus, lets you specify which CPUs to allow execution in.read_only, like docker run --read-only, lets you mount a container's filesystem as read-only.security_opt, like docker run --security-opt, lets you specify security options.log_driver, like docker run --log-driver, lets you specify a log driver.Many bugs have been fixed, including the following:
docker-compose run was sometimes truncated, especially when running under Jenkins.docker-compose.yml.docker-compose run --rm would fail to remove the container if the service had a restart policy in place.docker-compose scale would refuse to scale a service beyond 1 container if it exposed a specific port number on the host.Thanks @ahromis, @albers, @aleksandr-vin, @antoineco, @ccverak, @chernjie, @dnephin, @edmorley, @fordhurley, @josephpage, @KyleJamesWalker, @lsowen, @mchasal, @noironetworks, @sdake, @sdurrheimer, @sherter, @stephenlawrence, @thaJeztah, @thieman, @turtlemonvh, @twhiteman, @vdemeester, @xuxinkun and @zwily!
docker-compose.yml now supports an extends option, which enables a service to inherit configuration from another service in another configuration file. This is really good for sharing common configuration between apps, or for configuring the same app for different environments. Here's the documentation.
When using Compose with a Swarm cluster, containers that depend on one another will be co-scheduled on the same node. This means that most Compose apps will now work out of the box, as long as they don't use build.
Repeated invocations of docker-compose up when using Compose with a Swarm cluster now work reliably.
Directories passed to build, filenames passed to env_file and volume host paths passed to volumes are now treated as relative to the directory of the configuration file, not the directory that docker-compose is being run in. In the majority of cases, those are the same, but if you use the -f|--file argument to specify a configuration file in another directory, this is a breaking change.
A service can now share another service's network namespace with net: container:<service>.
volumes_from and net: container:<service> entries are taken into account when resolving dependencies, so docker-compose up <service> will correctly start all dependencies of <service>.
docker-compose run now accepts a --user argument to specify a user to run the command as, just like docker run.
The up, stop and restart commands now accept a --timeout (or -t) argument to specify how long to wait when attempting to gracefully stop containers, just like docker stop.
docker-compose rm now accepts -f as a shorthand for --force, just like docker rm.
Thanks, @abesto, @albers, @alunduil, @dnephin, @funkyfuture, @gilclark, @IanVS, @KingsleyKelly, @knutwalker, @thaJeztah and @vmalloc!
Fig has been renamed to Docker Compose, or just Compose for short. This has several implications for you:
docker-compose, not fig.docker-compose, so install it with pip install docker-compose.Besides that, there’s a lot of new stuff in this release:
We’ve made a few small changes to ensure that Compose will work with Swarm, Docker’s new clustering tool (https://github.com/docker/swarm). Eventually you'll be able to point Compose at a Swarm cluster instead of a standalone Docker host and it’ll run your containers on the cluster with no extra work from you. As Swarm is still developing, integration is rough and lots of Compose features don't work yet.
docker-compose run now has a --service-ports flag for exposing ports on the given service. This is useful for e.g. running your webapp with an interactive debugger.
You can now link to containers outside your app with the external_links option in docker-compose.yml.
You can now prevent docker-compose up from automatically building images with the --no-build option. This will make fewer API calls and run faster.
If you don’t specify a tag when using the image key, Compose will default to the latest tag, rather than pulling all tags.
docker-compose kill now supports the -s flag, allowing you to specify the exact signal you want to send to a service’s containers.
docker-compose.yml now has an env_file key, analogous to docker run --env-file, letting you specify multiple environment variables in a separate file. This is great if you have a lot of them, or if you want to keep sensitive information out of version control.
docker-compose.yml now supports the dns_search, cap_add, cap_drop, cpu_shares and restart options, analogous to docker run’s --dns-search, --cap-add, --cap-drop, --cpu-shares and --restart options.
Compose now ships with Bash tab completion - see the installation and usage docs at https://github.com/docker/compose/blob/1.1.0/docs/completion.md
A number of bugs have been fixed - see the milestone for details: https://github.com/docker/compose/issues?q=milestone%3A1.1.0+
Thanks @dnephin, @squebe, @jbalonso, @raulcd, @benlangfield, @albers, @ggtools, @bersace, @dtenenba, @petercv, @drewkett, @TFenby, @paulRbr, @Aigeruth and @salehe!
--allow-insecure-ssl option to allow fig up, fig run and fig pull to pull from insecure registries.fig run not showing output in Jenkins.The highlights:
This means the GitHub repository has moved to https://github.com/docker/fig and our IRC channel is now #docker-fig on Freenode.
Fig can be used with the official Docker OS X installer. Boot2Docker will mount the home directory from your host machine so volumes work as expected.
Fig supports Docker 1.3.
It is now possible to connect to the Docker daemon using TLS by using the DOCKER_CERT_PATH and DOCKER_TLS_VERIFY environment variables.
There is a new fig port command which outputs the host port binding of a service, in a similar way to docker port.
There is a new fig pull command which pulls the latest images for a service.
There is a new fig restart command which restarts a service's containers.
Fig creates multiple containers in service by appending a number to the service name (e.g. db_1, db_2, etc). As a convenience, Fig will now give the first container an alias of the service name (e.g. db).
This link alias is also a valid hostname and added to /etc/hosts so you can connect to linked services using their hostname. For example, instead of resolving the environment variables DB_PORT_5432_TCP_ADDR and DB_PORT_5432_TCP_PORT, you could just use the hostname db and port 5432 directly.
Volume definitions now support ro mode, expanding ~ and expanding environment variables.
.dockerignore is supported when building.
The project name can be set with the FIG_PROJECT_NAME environment variable.
The --env and --entrypoint options have been added to fig run.
The Fig binary for Linux is now linked against an older version of glibc so it works on CentOS 6 and Debian Wheezy.
Other things:
fig ps now works on Jenkins and makes fewer API calls to the Docker daemon.--verbose displays more useful debugging output.volumes_from points to a service without any containers running, that service will now be started.Thanks @dnephin, @d11wtq, @marksteve, @rubbish, @jbalonso, @timfreund, @alunduil, @mieciu, @shuron, @moss, @suzaku and @chmouel! Whew.
--no-cache option to fig build, which bypasses the cache just like docker build --no-cache.dns: fig.yml option, which was causing fig to error out.Thanks @dnephin and @marksteve!
fig run [service] with no further arguments will run it.volumes_from now works properly with containers as well as servicesfig upThanks @ryanbrainard and @d11wtq!
fig run or fig up.For example, if you have a web service which depends on a db service, fig run web ... will start the db service.
Environment variables can now be resolved from the environment that Fig is running in. Just specify it as a blank variable in your fig.yml and, if set, it'll be resolved:
environment:
RACK_ENV: development
SESSION_SECRET:
volumes_from is now supported in fig.yml. All of the volumes from the specified services and containers will be mounted:
volumes_from:
- service_name
- container_name
A host address can now be specified in ports:
ports:
- "0.0.0.0:8000:8000"
- "127.0.0.1:8001:8001"
The net and workdir options are now supported in fig.yml.
The hostname option now works in the same way as the Docker CLI, splitting out into a domainname option.
TTY behaviour is far more robust, and resizes are supported correctly.
Load YAML files safely.
Thanks to @d11wtq, @ryanbrainard, @rail44, @j0hnsmith, @binarin, @Elemecca, @mozz100 and @marksteve for their help with this release!
fig run, fig up and fig build.fig run.fig up now stops all services when any container exitsprivileged config option in fig.yml (thanks @kvz!)fig up outputfig run link back to their own servicefig build/run/up output (thanks @mauvm and @shanejonas!)--rm option to fig run. (Thanks @marksteve!)expose option to fig.yml.fig rm throwing an error.fig ps on Docker 0.8.1 when there is a container with no command.-f flag to specify alternate fig.yml filesThanks @marksteve, @Gazler and @teozkr!
fig up not printing log outputThanks to @barnybug and @dustinlacewell for their work on this release.
.yaml extension. (#58)Big thanks to @cameronmaske, @mrchrisadams and @damianmoore for their help with this release.
REDIS_1_PORT_6379_TCP_ADDR. (#54)-T option to fig run to disable pseudo-TTY. (#34)fig up requiring the ubuntu image to be pulled to recreate containers. (#33) Thanks @cameronmaske!fig run. (#34, #39, #40)fig up, ensuring config is up-to-date with fig.yml (#2)fig scale command (#9)DOCKER_HOST environment variable to find Docker daemon, for consistency with the official Docker client (was previously DOCKER_URL) (#19)fig ps (#18)fig.yml is missing (#4)fig build logging (#3)Big thanks to @tomstuart, @EnTeQuAk, @schickling, @aronasorman and @GeoffreyPlitt.
tcp://localdocker:4243 and a UNIX socket in addition to localhost.fig up behaviourfig rmfig build commandInitial release.