Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
412 stars 201 forks source link

Cannot connect to the Docker in Cloud Shell #1206

Closed v-hongli1 closed 1 year ago

v-hongli1 commented 1 year ago

Describe the issue: Can't start the docker in Cloud Shell.

Repro Steps:

  1. Login to Azure Portal
  2. Open Cloud Shell terminal
  3. Installation: to install run “mkdir -b ~/bin && curl -fsSL https://aka.ms/install-azd.sh | bash -s -- --install-folder ~/bin”
  4. Create a folder for test templates
  5. Run command azd init -t <template>
  6. Run command azd up

Error Message: image

Error Trace: After investigation, docker needs to be started, but we are neither the root user nor do we know the root password, so we can't start docker. image

Environment: OS: Cloud Shell Template:

Azd version: 0.4.0-beta.1 (commit 2bf7a529914d86d8e9f5d7b6f95a4f20a2351e01)

Expected behavior: The docker service can successfully start.

@danieljurek for notification.

rajeshkamal5050 commented 1 year ago

@danieljurek should we reach-out to the Cloud Shell team on this for making our ACA templates work in Cloud Shell?

danieljurek commented 1 year ago

Possible solution... use an ACR task to build in the ACR instance. https://learn.microsoft.com/en-us/azure/container-registry/container-registry-tasks-overview#quick-task

danieljurek commented 1 year ago

Docker daemon on the host is not supported in Cloud Shell currently: https://learn.microsoft.com/en-us/azure/cloud-shell/troubleshooting#you-cant-run-the-docker-daemon

Recommendation is to do actions which require the docker daemon (e.g. docker build) on another host.

rajeshkamal5050 commented 1 year ago

Docker daemon on the host is not supported in Cloud Shell currently: https://learn.microsoft.com/en-us/azure/cloud-shell/troubleshooting#you-cant-run-the-docker-daemon

Recommendation is to do actions which require the docker daemon (e.g. docker build) on another host.

Thanks for finding out more Daniel.

@savannahostrowski @puicchan @jongio If Cloud Shell doesn't natively support what we want. Instead of circumventing and making it work. Should we callout saying ACA templates are not supported form Cloud Shell?

savannahostrowski commented 1 year ago

Pinged the Cosmos team to check in on if there are particular scenarios they are targeting, which might help inform our path forward.

savannahostrowski commented 1 year ago

I think we can proceed and document this as a known limitation for now. I'll mark as docs, cc: @gkulin

rajeshkamal5050 commented 1 year ago

Should be added to doc in the release which contains CloudShell support in Azd. Currently it is blocked with the JDK upgrade #1207

v-xuto commented 1 year ago

@danieljurek The same issue also occurs in the following cases, failed to connect to the Docker.

gkulin commented 1 year ago

closed with https://github.com/MicrosoftDocs/azure-dev-docs-pr/pull/4193

it was added to the troubleshooting page: https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/troubleshoot#cannot-connect-to-the-docker-daemon-in-cloud-shell

cc @rajeshkamal5050 since I don't have permissions to close issues