If the aim is simple portability, I think it would be better to use Docker to create a lightweight image. Dagger supports general-purpose programming languages. So it allows you to write powerful logic.
Dagger is powerful, but I found the migration challenging because it’s the heavy tool with its quirks.
Dagger wasn’t right for my needs.
I created a small tool (https://github.com/lask-task-runner/lask) for building lighter, simpler Docker layers. At my work, a simple tool like this was enough.