How to Use Podman to run Workflows in Digdag

Podman as an alternative to Docker. It can be used for managing and running containers on Linux. Podman is daemonless and can be run as non-root. The best part of Podman is that the command-line front end matches exactly that of Docker; hence in almost all cases, you can just set an alias and use it instead of Docker. Or you can find and replace "docker" with "podman"; it should work.

I often try to use Docker with my Digdag workflows. That way, we can keep the dependencies clean and separate for each DAG. I have blogged about it in detail before. Now instead of Docker, I can use Podman, by just making one small change.

The docker part in the dag file takes the path of docker binary in cases where it is not on the path. So use it to give the path of podman. And it should work. See the dig file below.

timezone: UTC

    image: "alpine:3.15.3"
    docker: "/usr/bin/podman"
    pull_always: true
    selinux: true

  echo>: start ${session_time}

 sh>: wget -q -O /dev/null${session_time}  

  echo>: finish ${session_time}

Remember only three operators, sh>, py>, and rb> support Command Executor. i.e they run inside the container. Other operators run on host systems. Hence if you want the http ping to happen inside the container you should use one of these operators and not http> operator. I am using sh> operator here.

You can read this blog using RSS Feed. But if you are the person who loves getting emails, then you can join my readers by signing up.

Join 2,153 other subscribers