Docker applications. • Services and dependencies are defined in YAML file to configure application. • Using single command, you create and start all the services from your configuration. • Also works with swarm. • Tool for developers. https://docs.docker.com/compose/ Diagram Credit : cloudacademy
isolate the environments from each other • Compose preserves all volumes used by the services defined in the compose file, thus no data is lost when the containers are recreated • Containers which have changed are recreated, the containers whose state did not change remain untouched • Support for variables in the compose file, we can define variables in a .env file and use them in the docker-compose file https://docs.docker.com/compose/
exposes low-level primitives for building the full range of distributed systems. • • There are more than 50 first-class objects in the latest release, from Pods and Deployments to ValidatingWebhookConfiguration and ResourceQuota etc • • This can lead to a verbosity in configuration, which then needs to be managed by you, the developer. kubernetes APIs Compose on Kubernetes • Compose meanwhile isn’t an API but a high-level tool focused on developer productivity • For the common case of a set of interconnected web services, Compose provides an abstraction that simplifies Kubernetes configuration • For everything else you can still drop down to the raw Kubernetes API primitives
-File | Get-Content | Measure-Object -line).Lines 908 $ cd ../../docker-compose $ (Get-Content docker-compose.yml | Measure-Object -line).Lines 174 More than 5x code is reduced in compose as compared to raw k8s object description