For Docker, stacks will be the standard way of packaging applications made by multiple containers. Consider the hyper inflated WordPress example: You need a minimum of one web server and one database.
Developers usually describe these applications with Compose, by creating a YAML, as shown:
version: '2' services: db: image: mysql:5.6 volumes: - "./.data/db:/var/lib/mysql" restart: always environment: MYSQL_ROOT_PASSWORD: dockerswarm MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on: - db image: wordpress:latest links: - db ports: - "8000:80" restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_PASSWORD: wordpress
Then, they launch this application with a command such as:
docker-compose --rm -d --file docker-compose.yml up.
Here, mysql
and wordpress
containers are scheduled, pulled, and started as daemons...