Installing Podman
You should be able to install Podman using any standard package installation tool on your Linux distribution. In RHEL 8 this would be achieved by running yum install podman
, for example.
Create an alias to align Docker and Podman commands
Follow the steps below to add an alias and reload your .bashrc
file:
-
Run the following command to add the alias to your
.bashrc
file:-
printf "\nalias docker=podman\n" >> ~/.bashrc
-
-
Reload your bash config:
-
source ~/.bashrc
-
Edit setup script
While the alias set up in step 3 allows for you to run commands like docker stop <container-name>
without blinking an eye, it does not solve for every difference between Docker and Podman when setting up the gateway.
We will need to make two edits to the setup script:
Standard script example: (for outbound encrypt on port 9001 – do not copy and paste this script)
docker run \
--env-file /var/virtru/vg/env/oe-9001.env \
-v /var/virtru/vg/tls/:/etc/postfix/tls \
-v /var/virtru/vg/queue/oe-9001/:/var/spool/postfix \
-v /var/virtru/vg/dkim/:/etc/opendkim/keys \
--name oe-9001 \
--publish 9001:25 \
--interactive --tty --detach \
--restart unless-stopped \
--log-driver json-file \
--log-opt max-size=10m \
--log-opt max-file=100 \
virtru/gateway:latest
Modified script example: (for outbound encrypt on port 9001 – do not copy and paste this script)
podman run \
--env-file /var/virtru/vg/env/oe-9001.env \
-v /var/virtru/vg/tls/:/etc/postfix/tls \
-v /var/virtru/vg/queue/oe-9001/:/var/spool/postfix \
-v /var/virtru/vg/dkim/:/etc/opendkim/keys \
--name oe-9001 \
--publish 9001:25 \
--interactive --tty --detach \
--restart unless-stopped \
--log-driver json-file \
--log-opt max-size=10m \
--log-opt max-file=100 \
docker.io/virtru/gateway:latest
As you can see, we have changed the docker run
in line 1 to podman run
, since the shell script can not leverage our alias. The other change is on line 13. Since Podman can run containers from multiple different registries, you have to designate which registry you’d like to pull from. In this case, that would be Docker (docker.io)