Open hut8 opened 3 months ago
The tasks create command determines which of the supported 3 types of tasks (FilteTaskStep, EncodedTaskStep and DockerBuildStep) needs to process based on the parameters input. If a context path is provided (-c) it discards EnconcedTaskStep scenario and checks for the file extension. Then if the file extension is any of the following: '.yaml', '.yml', '.toml', '.json', '.sh', '.bash', '.zsh', '.ps1', '.ps', '.cmd', '.bat', '.ts', '.js', '.php', '.py', '.rb', '.lua', it assumes is a FileTaskStep, otherwise, it'll treat it as a dockerBuildStep. Since php was not part of the allowed task file steps extensions in the CLI, it's handling php files or any other that don't match the previous list as a Docker file.
Describe the bug
When running a command like this:
I very mysteriously get:
I was very confused because there was no YAML anywhere.
Google pointed me to this issue: https://github.com/Azure/acr/issues/390 which only partially helped me. It made me realize that
--file
can either specify a YAML file or a Dockerfile. I then began to believe that maybe the Dockerfile was being interpreted as a YAML file.There seems to be some logic in Azure that will determine whether the file specified with
--file
is a Dockerfile or a YAML descriptor of a potentially multi-step build process. That logic seems to be a little faulty. I have aDockerfile.base
which defines my organization's most basic image. That one is correctly detected as a Dockerfile. Then, I need to build an image that has the correct installation of PHP. Following a convention I've seen elsewhere (for example, this post which specifies multiple Dockerfiles differing only by their "extension" ), I named thisDockerfile.php
Replacing the first command in this bug report with:
succeeds. The only change is
Dockerfile.php
becomesDockerfile-php
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Dockerfile.php will be interpreted as a Dockerfile. I think that
Dockerfile.*
should be considered a dockerfile.Screenshots
None.
Any relevant environment information
Additional context
None