Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

What's the difference between docker compose and podman compose?


Asked by Madelynn Douglas on Dec 02, 2021 Docker



The basic idea behind Podman Compose is that it picks the services defined inside the docker-compose.yaml file and creates a container for each service. A major difference between Docker Compose and Podman Compose is that Podman Compose adds the containers to a single pod for the whole project, and all the containers share the same network.
Next,
Below is a docker-compose.yml example taken from the docker docs: A Dockerfile is a text document that contains all the commands/Instruction a user could call on the command line to assemble an image. Docker Compose is a tool for defining and running multi-container Docker applications.
Indeed, Podman 3.0 (released in February 2021) introduced support for the standard docker-compose. Podman now supports the Docker REST API well enough to be able to serve the needs of docker-compose. Podman can listen on a UNIX domain socket or a TCP socket that docker-compose connects to (instead of to the Docker daemon). Two notable caveats though
Subsequently,
Docker Compose: Allows configuring and starting multiple docker containers. This is mostly used as a helper when you want to start multiple docker containers and don't want to start each one separately using docker run .... Docker compose is used for starting containers on the same host.
Likewise,
Naming of the containers is done similar to Docker Compose. For example, for your web service, a container named wpsite_web_1 is created. Podman Compose also adds localhost aliases to each named container. Then, containers can still resolve each other by name, although they are not on a bridge network as in Docker.