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

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

+setup:
  echo>: start ${session_time}

+ping:
 sh>: wget -q -O /dev/null https://webhook.site/90404ec5-3dab-4775-bdca-73602a5f842f?session=${session_time}  

+teardown:
  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,237 other subscribers

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.