Azure / Azure/azure-functions-core-tools
Prompt to create dockerfile when one doesn't exist for docker build
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 498
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 14
Description
If you run `func kubernetes deploy` in a directory you haven't yet generated a docker file, you get this error:
>Error running docker build -t registry/python-function C:\File\Path.
output:
> unable to prepare context: unable to evaluate symlinks in Dockerfile path: CreateFile C:\File\Path\Dockerfile: The system cannot find the file specified.
The fix is simple enough, just run `func init --docker-only` and you have a dockerfile. However would be great if this error either:
1. Suggested running `func init --docker-only` first to generate a Dockerfile
2. Actually prompted if you wanted to generate a Dockerfile first, and then ran that command for you
Contributor guide
Research direction
Start with the `func kubernetes deploy` path that invokes `docker build` when no Dockerfile exists, and compare its failure with `func init --docker-only`. Confirm whether the intended behavior is to suggest the command or prompt and run it; done means the missing-Dockerfile case gives the agreed guidance or prompt instead of the current error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, docker
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100