[Container - Podman] Podman Compose - An implementation of Compose Spec with Podman backend
Podman Compose
Podman Compose is an implementation of Compose Spec with Podman backend. This project focus on:
-
Rootless
-
Daemonless process model, we directly execute
podman
, no running daemon.
This project only depend on:
-
podman
-
podman dnsname plugin (Optional requirement. If necessary, the containers be able to resolve each other if they are on the same CNI network. In distributions, it is usually found in the podman-plugins or podman-dnsname package)
-
Python3
-
PyYAML
-
python-dotenv
Installation
Install latest stable version from PyPI:
1 | pip3 install podman-compose |
pass --user
to install inside regular user home without being root.
Or latest development version from GitHub:
1 | pip3 install https://github.com/containers/podman-compose/archive/devel.tar.gz |
or
1 | curl -o /usr/local/bin/podman-compose https://raw.githubusercontent.com/containers/podman-compose/devel/podman_compose.py |
or inside your home
1 | curl -o ~/.local/bin/podman-compose https://raw.githubusercontent.com/containers/podman-compose/devel/podman_compose.py |
or install from Fedora (starting from f31) repositories:
1 | sudo dnf install podman-compose |
Basic Usage
We have included fully functional sample stacks inside examples/ - https://github.com/containers/podman-compose/tree/devel/examples directory.
A quick example would be
1 | cd examples/busybox |
A more rich example can be found in examples/awx3 - https://github.com/containers/podman-compose/tree/devel/examples/awx3 which have
-
A Postgres Database
-
RabbitMQ server
-
MemCached server
-
a django web server
-
a django tasks
When testing the AWX3 example, if you got errors just wait for db migrations to end. There is also AWX 17.1.0
FAQs
podman-compose ModuleNotFoundError: No module named ‘dotenv’
1 | podman-compose |
Remember to install python-dotenv
module.
1 | pip3 install python-dotenv |
See import - no module named ‘dotenv’ python 3.8 - Stack Overflow - https://stackoverflow.com/questions/59572174/no-module-named-dotenv-python-3-8 to learn more.
Error: unrecognized command `podman network exists
podman
1.6.4 not support podman network exist
command.
1 | podman -v |
podmon
3.3.1+
1 | podman -v |
References
[2] Overview of Docker Compose | Docker Documentation - https://docs.docker.com/compose/