I wanted to start playing with Ansible-Semaphore on my homelab. Ansible-Semaphore is an open source project that provides a very attractive Web UI for Ansible. The project provides methods for installing the software as a snap package, as a package on RHEL and Debian platforms, as a pre-compiled binary, but for me the most straightforward way was to use their container bundle. The bundle includes a container to host and serve the Web UI and another container to serve its database. But first I was going to need to get docker-compose working with my Podman installation on RHEL9. I realize that there is now a podman-compose available, but it’s not yet as feature-complete as docker-compose.
Here’s what I did to configure docker-compose on a RHEL9 system:
As root perform the following steps:
- Run
dnf updateon the target system to bring all installed packages up to date. - Run
dnf install podmanto install podman and its dependencies. - Run
podman --versionto check your version of podman. We’ll need podman version 3.0 or higher. - Run
systemctl enable --now podman.serviceto start and enable podman as a systemd service. Podman doesn’t run as a service by default, but we’ll need it running as a service to work with docker-compose. - Run ‘systemctl enable –now podman.socket` to start and enable the podman socket. We’ll also need this to work with docker-compose.
- Run ‘dnf install podman-docker’. This package installs a script named docker which emulates the Docker CLI and executes podman commands.
- Copy and paste the following into a root shell to download and install docker-compose:
curl -L "https://github.com/docker/compose/releases/download/v2.19.0/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose
Note: This curl command will pull down docker-compose for the x86_64 architecture. If your architecture differs see the docker compose releases page for your architecture.
- Finally, make /usr/local/bin/docker-compose executable with `chmod u+x`.
That’s all there is to it!
To test:
- Clone the awesome-compose samples from docker’s github with
git clone https://github.com/docker/awesome-compose. - Change directory to awesome-compose/gitea-postgres
- Run
docker-compose up
This will pull and start containers required to host the gitea git service. You can verify that podman is managing these containers by switching to another terminal and executing the podman ps command. Press control-c to end the test, and `podman rm` to clean out any containers related to gitea. If you didn’t have any other containers running prior to this test, podman rm * will clean them all out.
Now you have a sane environment to host and test ansible-semaphore, or anything bundled with docker-compose.