Azure-docs: DotNet Container Error

Created on 12 Oct 2018  Â·  9Comments  Â·  Source: MicrosoftDocs/azure-docs

I wanted to leave a comment for anyone else struggling with getting a dotnet core container running on Linux and see if there was an explanation or I'm just misunderstanding.

I kept getting errors saying that it couldn't find dotnet even though the container ran fine locally and on ACI. After reading the section Container settings for the task I decided to randomly try changing the dockerfile to the absolute path of the dotnet runtime and it magically worked. I'm not entirely sure why as my assumption was that since dotnet was on the path regardless of the working directory it should be found but it seems that is not the case.

Working container: https://hub.docker.com/r/jefking/imageresizer/tags/ version 1.2.4


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

assigned-to-author batcsvc doc-enhancement triaged

Most helpful comment

I find this really confusing. I was able to run the container on several other platforms, while it was failing on Azure Batch. Unless there is some really good logging and rational brought to the users attention; I don't feel this is a good experience.
Lastly, a huge selling point of containers is to have portability; and we took a code change to get it to run on Azure Batch. There will be more and more workloads, overtime; where the container will not be able to be modified just to run it on Azure Batch.

All 9 comments

Thanks for the feedback! We are currently investigating and will update you shortly.

@nastassiar I have assigned this to the content author to review and see if we can add anything to this doc to make it more clear.

@nastassiar - Thanks for pointing out this issue. I believe this behavior is specific to the Batch implementation of containers in the task context. This guidance in the article tries to alert customers:

"Because Batch changes the default working directory in your container, the task runs in a location different from the typical container entry point (for example, c: by default on a Windows container, or / on Linux). Make sure that your task command line or container entry point specifies an absolute path, if it isn't already configured that way."

I think this covers the point, but perhaps this guidance needs to be more prominent?

I find this really confusing. I was able to run the container on several other platforms, while it was failing on Azure Batch. Unless there is some really good logging and rational brought to the users attention; I don't feel this is a good experience.
Lastly, a huge selling point of containers is to have portability; and we took a code change to get it to run on Azure Batch. There will be more and more workloads, overtime; where the container will not be able to be modified just to run it on Azure Batch.

Agreed with Jef, it's really weird that Batch would be a specific case when it comes to running containers, we should follow the _de facto_ standard of the industry and leave the default entry point.

The problem is batch doesn't honor WORKDIR of image, we added workitem to track this issue,

During the meantime, in order to let this image work, please add "-w /app" to taskContainerSetting. This extra setting will override the Batch default working directory.

This feedback is all very helpful. I am submitting a pull request with a small doc update to clarify the current behavior and suggested workaround.

Doc update merged.

please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdcoder2 picture bdcoder2  Â·  3Comments

ianpowell2017 picture ianpowell2017  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments