-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Description
Bundles
Bundles are a multi-image redistributable format that describe multi-container distributed applications (or stacks) running on Docker. A bundle is akin to a “multi-image image,” and deploying it gives rise to a “stack” consisting of several communicating microservices. Conceptually, this is analogous to Docker images today:
| Human-editable Description | Binary Artifact | Running Instantiation | |
|---|---|---|---|
| Bundle | docker-compose.yml |
Bundle | Stack |
| Image | Dockerfile | Image | Container |
In June 2016, Docker announced Distributed Application Bundle (DAB) files, a predecessor to bundles, as part of Docker 1.12. DAB is the file format used internally to represent bundles.
This issue outlines the roadmap for bundles, the file formats involved, how they relate to one another, how bundles relate to existing multi-container tools like Docker Compose and how the CLI/API will be affected.
Docker 1.12 Concepts: Swarm Mode, Bundles and docker deploy
Engine swarm mode orchestration (Docker services). Since Docker 1.12, Engine has supported built-in container orchestration through the addition of Docker Services (docker service and related subcommands). A Service in Docker is a replicated set of 1 or more identical containers. Loosely speaking, a Service in Docker models the concept of a “microservice” within a larger application.
Bundles. A bundle can be generated from a Compose v2 file. The bundle itself is a redistributable binary format, and in the future docker-compose will be just one possible build tool. When a bundle is deployed to a cluster, its running instantiation is called a stack.
docker deploy. This subcommand is used in 1.12 to deploy a Distributed Application Bundle (DAB, or simply bundle) file.
Roadmap: Compose files, Bundle files, Daemon-side Bundles and docker stacks
As of Docker 1.12, docker-compose is currently the tool used to create bundle files. A bundle file is generated from a Compose v2 file using docker-compose bundle [-f docker-compose.yml]. It is then deployed using the docker deploy subcommand: docker deploy --file mystack.dab. A more complete description of this 1.12 functionality is available here.
In Docker 1.13/1.14, our intention is to shift away from using docker-compose to generate bundles. Instead, the docker CLI itself will generate bundles from Compose v2 input files using a new docker bundle subcommand. Example:
docker bundle build [-f COMPOSE_FILE] -t BUNDLE
In addition, Docker will move toward a system in which bundles are stored and managed internally by the Engine rather than as user-managed .dab files. For instance, the user will be able to push and pull bundles:
docker bundle push BUNDLE (see below)
docker bundle pull BUNDLE (see below)
Other docker bundle commands like bundle ls, bundle tag and bundle rm will allow the user to manage these daemon-side bundles.
Deployment and management of running stacks will be done using the top level docker stack subcommand (which already existed in 1.12 and will be extended in 1.13/1.14). Deployment of a bundle to instantiate a stack will be done using docker stack deploy; docker deploy will be aliased to this command for backward compatibility. For management, existing commands such as docker stack ps, docker stack inspect and docker stack rm will be available to view and manipulate running stacks.
Example Workflows
Running a stack from a Compose file
docker bundle build [-f COMPOSE_FILE] -t BUNDLE
docker stack deploy [-c STACK_CONFIG] BUNDLE STACK
Running a stack from a registry
docker stack deploy [-c STACK_CONFIG] BUNDLE STACK