dapr / cli

Command-line tools for Dapr.
Apache License 2.0
317 stars 202 forks source link

dapr init --container-runtime podman #1300

Closed Gio2241 closed 1 year ago

Gio2241 commented 1 year ago

When there is no podman installed and try to run this command:

dapr init --container-runtime podman

Going to get this error:

❌  could not connect to Docker. Docker may not be installed or running

It should be:

❌  could not connect to Podman. Podman may not be installed or running
CLI version: 1.10.0 
Runtime version: 1.10.7
pravinpushkar commented 1 year ago

@kochia7 in slim mode there is no need for a container runtime. It should have installed w/o any error. In fact you should use just this command - dapr init --slim.

See here for more info - https://docs.dapr.io/operations/hosting/self-hosted/self-hosted-no-docker/

Gio2241 commented 1 year ago

@kochia7 in slim mode there is no need for a container runtime. It should have installed w/o any error. In fact you should use just this command - dapr init --slim.

See here for more info - https://docs.dapr.io/operations/hosting/self-hosted/self-hosted-no-docker/

Sorry for mistake, I just copied the last command and included the runtime parameter (fixed the post)

shubham1172 commented 1 year ago

Hi @kochia7, this has been fixed in the latest CLI version. Please check.

With v1.10

~ ❯ dapr --version
CLI version: 1.10.0
Runtime version: n/a

Condition: docker is stopped and podman uninstalled.

~ ❯ dapr init --container-runtime podman
⌛  Making the jump to hyperspace...
❌  could not connect to Docker. Docker may not be installed or running

With v1.11

~ ❯ dapr --version
CLI version: 1.11.0-rc.3
Runtime version: n/a

Condition: docker is stopped and podman uninstalled.

~ ❯ dapr init --container-runtime podman
⌛  Making the jump to hyperspace...
❌  could not connect to podman. podman may not be installed or running
shubham1172 commented 1 year ago

However, if I have docker running, I get this error:

~ ❯ dapr init --container-runtime podman
⌛  Making the jump to hyperspace...
ℹ️  Container images will be pulled from Docker Hub
ℹ️  Installing runtime version 1.10.7
❌  Downloading binaries and setting up components...
❌  unable to confirm whether dapr_zipkin is running or exists. error
exec: "podman": executable file not found in $PATH

This is different from what we expect. The root cause is -

https://github.com/dapr/cli/blob/96e225432a0b6d3a3a9416cd8fa19766a1b3c105/pkg/standalone/standalone.go#L165-L167

Instead of checking for the correct runtime being present or not, we check "either". The check passes because Docker is running, but fails later because podman is not installed.

/cc @pravinpushkar

pravinpushkar commented 1 year ago

@shubham1172 yes, this makes sense. We can fix this for 1.12.