Closed schnie closed 1 week ago
Tagging @lzdanski since this can help simplify the podman docs a bit.
@rob-1126 I think you originally add the podman binary support. Any concerns here?
@yanmastin-astro Move step 2 to a "tip" box and note that it's required for versions less than 1.31. In release notes, add a section called ### Behavior changes
that this step is no longer necessary. In additional improvements
this bit: the ability for the CLI to autodetect the container runtime binary to use for the commands that utilize containers.
Description
This PR adds the ability for the CLI to autodetect the container runtime binary to use for the commands that utilize containers. If the already existing configuration (
containers.binary
) is set in theconfig.yaml
file, we use that, otherwise we search file paths in$PATH
fordocker
, thenpodman
. Others can be added if needed.Previously all commands that used the container runtime would grab the configuration directly (
config.CFG.DockerCommand.GetString()
). We've replaced all instances of this with calls to a new function that wraps up this configuration and layers on the auto-detection piece.This is a small piece of a larger project to simplify getting started with Astro CLI. We're also exploring the idea of bundling podman with our package and using it as our default, rather than Docker Desktop. This is part of that effort, but also just useful on its own.
New functionality is in the new files here. The other files are mostly just adapting to the new method signature.
This effectively makes the highlighted command show below unnecessary when using podman.
🎟 Issue(s)
Related to https://github.com/astronomer/astro/issues/24344
🧪 Functional Testing
Tested on Mac and Windows with Docker Desktop, Orbstack (docker binary), and Podman.
Mac OS
astro dev start
with no container runtime installedastro dev start
after runningbrew install podman
Automatically detectspodman
binary and uses it.astro dev start
after additionally runningbrew install orbstack
(docker
binary) Both binaries are installed anddocker
is selected, as it's first in our list.astro dev start
after installing both binaries, but manually overriding topodman
with the config fileWindows OS
Uninstalled podman and attempted to
astro dev start
. We see the helpful error message.Installed podman and attempt to
astro dev start
again. Once podman is installed, we can successfully runastro dev start
and view the webserver in the browser.📋 Checklist
make test
before taking out of draftmake lint
before taking out of draft