#Dagger Engine: Prioritizing nerdctl over Docker (with fallback) - Need ASAP!

1 messages · Page 1 of 1 (latest)

verbal vector
#

I'm running into a bit of a snag with my Dagger setup and hoping someone can help me out quickly. I have both Docker and nerdctl installed, and I'd like to configure the Dagger engine to always try using nerdctl first for my CI/CD pipelines and workflows. If, and only if, nerdctl isn't available or fails, I want it to fall back to Docker. I've been searching the docs and community, but haven't found a clear solution. This is blocking my progress, so any insights or pointers would be hugely appreciated! Thanks in advance!

viral elbow
#

👋 @verbal vector I took a quick look at the code base and it looks like docker is hardcoded (could be wrong). One thing you could potentially do is solve this with a function and alias in your shell.

  1. Add the your shell profile
dockercmd() { command -v nerdctl >/dev/null && nerdctl "$@" || command docker "$@"; }
  1. Create your alias
alias docker=dockercmd

Can you try that and let me know it that works for you?