Docker Compose is a powerful tool that enables you to launch multiple Docker images in a coordinated fashion.
Compose is a tool for defining and running multi-container Docker applications.
Compose uses a project name as identifier to isolate environments from each other.
Using Compose is basically a three-step process.
Compose has commands for managing the whole lifecycle of your application:
docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------------------------------------------------------------
quickstart_kafka_1 /etc/confluent/docker/run Up 0.0.0.0:29092->29092/tcp, 0.0.0.0:9092->9092/tcp
quickstart_ksql-cli_1 perl -e while(1){ sleep 99 ... Up
quickstart_ksql-datagen-pageviews_1 bash -c echo Waiting for K ... Exit 1
quickstart_ksql-datagen-users_1 bash -c echo Waiting for K ... Exit 1
quickstart_schema-registry_1 /etc/confluent/docker/run Up 0.0.0.0:8081->8081/tcp
quickstart_zookeeper_1 /etc/confluent/docker/run Up 2181/tcp, 2888/tcp, 0.0.0.0:32181->32181/tcp, 3888/tcp
docker-compose images
docker-compose top
See the process information and command
docker-compose up -d
# or
docker-compose up -d -f docker-compose.yml
# or
docker stack up -c docker-compose.yml Stack
where:
Configuration can be overwritten by another Docker - docker-compose.yml.
Example:
docker-compose -f docker-compose.yml -f rpm-overides.yml up
docker-compose up -d --build
docker-compose down
Stopping kafkasinglenode_kafka_1 ... done
Stopping kafkasinglenode_zookeeper_1 ... done
Removing kafkasinglenode_kafka_1 ... done
Removing kafkasinglenode_zookeeper_1 ... done
docker-compose up
The old container will be removed and the new one will created with the same name.