liveBook · Manning

Docker Compose

As explained in Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more

Docker Compose is a tool for defining and running multi-container applications.

Docker Compose defines and runs multi-container applications from YAML. It focuses on orchestrating multiple containers on one node, simplifying complex command lines; with Podman’s compatible REST API, docker-compose can launch rootless or rootful Podman containers. section 9.4 section 1.5

A Podman-backed Compose workflow involves:

  • Install docker-compose, start the user Podman socket, verify its ping endpoint, and set DOCKER_HOST to the Unix socket. section 9.4
  • Define services, images, bind mounts, named volumes, and port mappings in docker-compose.yaml. section 9.4
  • Run docker-compose up to pull and create containers, then inspect them and their volumes with Podman commands. section 9.4
  • Use docker-compose down to remove the application container and its default network. section 9.4

A single-service Compose definition

A service can use quay.io/rhatdan/myimage:latest, mount ./html at /var/www/html, attach a named volume at /vol, and publish port 8080 to container port 80. section 9.4

cat > docker-compose.yaml << _EOF
version: "3.7"
services:
  myapp:
    image: quay.io/rhatdan/myimage:latest
    volumes:
      - ./html:/var/www/html
      - myapp_vol:/vol
    ports:
      - 8080:80
volumes:
  myapp_vol: {}
_EOF

Inspect the complete Compose YAML used to launch a service through the Podman socket. section 9.4

How Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more covers it

How deep it goes
Explains installation, socket setup, YAML definition, launch, inspection, stopping, and teardown.
Examples
Uses a web service with an image, bind mount, named volume, port mapping, and Podman inspection commands.
What it assumes
Assumes basic Podman container management while introducing Compose YAML and the Podman REST socket workflow.
What you can do after
Operate multi-container applications through docker-compose against a rootless or rootful Podman socket.
How it connects
Connects Docker Compose with Podman, YAML, REST APIs, containers, volumes, networks, and Kubernetes.

Also explained in

Compare how 15 books explain Docker Compose →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more. The section links point to the parts of the book it draws on.