One challenge with Docker Compose is that the YAML file format only works with the Docker engine. While you can give it to other Docker users for local replication, they cannot use it with other container runtimes. That is, until now. Related tutorial: Using Podman and Docker Compose With Podman 3.0, the Docker Compose works with a Podman. Online store for products and services. The Enterprisers Project. Articles written by CIOs, for CIOs. Red Hat Marketplace. A place to try, buy, sell, and manage certified enterprise software for container-based environments. So you finally surrendered to containers and discovered that they solve a lot of problems and have a lot of advantages: First: Containers are immutable – The OS, library versions, configurations, folders, and application are all wrapped inside the container. You guarantee that the same image that was tested in QA will reach the production environment.
The Docker Compose tool has been valuable for many people who have been working with containers. According to the documentation, Docker Compose describes itself as:
... a tool for defining and running multi-container applications. With Compose, you use a YAML file to configure your application's services. Then, with a single command, you create and start all the services from your configuration.
One challenge with Docker Compose is that the YAML file format only works with the Docker engine. While you can give it to other Docker users for local replication, they cannot use it with other container runtimes. That is, until now.
[ Related tutorial: Using Podman and Docker Compose ]
With Podman 3.0, the Docker Compose works with a Podman backend
The real power of Podman shines through by easily converting the containers based on Docker Compose to a Kubernetes YAML file. Like Docker Compose, Podman can use the Kubernetes YAML file to replicate the containers locally. More importantly, this allows Podman to have an orchestrated pod and service that can be run on many platforms, including Kubernetes/OpenShift or minikube.
Kubernetes and OpenShift
This article explains the process of starting with a simple Compose file that runs WordPress using two containers. The source for this Compose file is published on GitHub in Docker's awesome-compose repository. Successful use of this file with Podman results in the WordPress initial setup screen appearing in a browser.
Note: At the time of this writing, we only support the docker-compose
command running rootfully.
Start Podman's system service
To use Compose, the first step is to make sure that all the required packages are installed and then to set up the Podman (3.0 or greater) system service using systemd
. After installing packages, enable and start the Podman systemd
socket-activated service using the following command:
Verify the service is running by hitting the ping endpoint. This step needs to be successful before proceeding further.
Rhel 8 Docker Swarm
You can now confidently run Compose knowing the RESTful API is working.
Run Compose
Redhat 8 Docker Image
As mentioned earlier, the example will run a Compose file consisting of two containers to bring up a WordPress session. One container runs an Apache web service, and the other stores the data in a MySQL database. The two containers communicate via TCP/IP over a network dedicated to this Compose instance. To bring up the containers, run docker-compose up
.
Use the podman ps
command to verify that two containers have been created and are now running. No Docker daemon was necessary.
Redhat 8 Docker-compose
Verify WordPress is running locally
Rhel 8 Docker Support
The instructions for running WordPress indicate that it is working correctly and it can be accessed using the localhost and port 80.