If you’ve built scores of docker-compose.yml files and are migrating to AlmaLinux, you’ll need to install the podman-compose tool so you can keep using those files. Jack Wallen shows you how.
Out of the box, AlmaLinux ships with the Docker replacement, Podman. That’s great, because Podman is, for the most part, a drop-in replacement for Docker. However, one thing that the default Podman installation doesn’t have is docker-compose, and many container admins are accustomed to using docker-compose to deploy apps and services. If you’ve spent weeks, months and years crafting those docker-compose files, you don’t want to have to let them go.
Fortunately, as of version 3 of Podman, there is an equivalent – podman-compose – and it is backwards compatible with all those Docker compose files you’ve created. However, that tool isn’t installed by default, and to make matters more complicated, the process of installing podman-compose is quite different.
SEE: 40+ open source and Linux terms you need to know (TechRepublic Premium)
I’m going to walk you through getting podman-compose installed on both AlmaLinux 8 and 9. Understand that AlmaLinux 9 is still in beta, so chances are slim you’re using that for your container deployments. However, once AlmaLinux 9 arrives, you will probably be migrating to the newest release. When that comes, there’s no guarantee the podman-compose utility will be in the standard repositories. Because of that, we have to turn to pip.
With that said, let me show you how to install podman-compose on both AlmaLinux 8 and 9.
What you’ll need to start
The only requirement is a running instance of either AlmaLinux 8 or 9 and a user with sudo privileges. Let’s get to work.
How to install podman-compose on AlmaLinux 8
This process is quite simple. Just log into your AlmaLinux 8 instance and issue the command:
sudo dnf install podman-compose -y
Once the installation is complete, you can verify it with the command:
You should see the help contents listed. That’s it: You’re done.
How to install podman-compose on AlmaLinux 9
This is where it gets a bit more complicated, as podman-compose isn’t found in the AlmaLinux 9 repositories. With AlmaLinux 9, installing podman-compose is all about Python.
First, install Python3 and Pip with:
sudo dnf install python3 python3-pip python3-devel -y
sudo -H pip3 install --upgrade pip
Next, we need to install the Python dotenv module with the command:
sudo pip3 install python-dotenv
Now, we can install pyyaml:
sudo pip3 install pyyaml
Finally, we can install podman-compose with pip, using the command:
sudo pip3 install podman-compose
Once this installation completes, issue the command:
You should again see the help contents for podman-compose.
If Python and Pip fail you, there’s another method that should also work. You can download the podman-compose binary and save it to
/usr/local/bin/ with the command:
sudo curl -o /usr/local/bin/podman-compose https://raw.githubusercontent.com/containers/podman-compose/devel/podman_compose.py
Once that file has been downloaded, give it the proper permissions with:
sudo chmod u+x /usr/local/bin/podman-compose
Again, run the command
If the help information appears, all is ready.
Congratulations, podman-compose is installed on AlmaLinux. You should now be able to use all of those docker-compose.yml files with the command:
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.