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
387 stars 177 forks source link

azd deploy "docker build" command error with container apps project [Issue] #4038

Open dkirby-ms opened 1 week ago

dkirby-ms commented 1 week ago

Output from azd version dakir@WIN-6FJOGCB45OV:~/health_ai$ azd version azd version 1.9.3 (commit e1624330dcc7dde440ecc1eda06aac40e68aa0a3)

Describe the bug azd deploy fails with an error during docker build due to a missing path in /tmp

dakir@WIN-6FJOGCB45OV:~/health_ai$ azd deploy

Deploying services (azd deploy)

(x) Failed: Deploying service api

ERROR: failed building service 'api': building container: api at .: building image: exit code: 1, stdout: , stderr: 0 building with "default" instance using docker driver

1 [internal] load .dockerignore 1 transferring context: 2B done 1 DONE 0.0s

....

10 exporting to image 10 exporting layers done 10 writing image sha256:53c907054d95fe74b2d9c8a5e519228210c3ad5691ab5d56a3b64ef12f3e5223 done 10 naming to docker.io/library/todo-python-mongo-aca-api done 10 DONE 0.0s ERROR: writing image ID file: open /tmp/azd-docker-build3555712615/imgId: no such file or directory

To Reproduce Create a project from todo-python-mongo-aca template and try to build it.

Expected behavior azd deploy works and docker build command completes without error.

Environment Information on your environment:

Additional context

The specific problem is that the --iidfile parameter passed to docker build is pointing to a randomly assigned /tmp/azd folder that doesnt actually exist. Docker build command fails because the folder doesnt exist.

vhvb1989 commented 4 days ago

@dkirby-ms , the temp folder is created just to write the imageId and it is deleted after that. It is expected that you don't see that folder after the error.

I have tried on my side and I was not able to reproduce. Can you share more details about your environment set up?

Can you run azd deploy --debug > fullLog.txt 2>&1 and share fullLog.txt ?

dkirby-ms commented 3 days ago

I am using VSCode with WSL and Ubuntu 22.04. I meant my local environment, sorry for the confusion. Log attached.

log.txt