Azure Batch: Docker Compatible Windows Image Failed at Node Preparation

David Dong 0 Reputation points
2024-02-05T22:34:24.28+00:00

Hi, I am trying to test an azure batch setup with a windows container. I noticed a few have been deprecated, but dsvm-win-2019 is available. In fact, it seems to be the only windows not marked EoL. When I start up a pool with this image, it fails with NodePreparation Error. Any way to resolve this? I was hoping to use something off the shelf, but my options are really constrained for a windows image. Thank you!

Pool Setup:

User's image

Pool's Node Error Message:

User's image

Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
302 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anveshreddy Nimmala 2,380 Reputation points Microsoft Vendor
    2024-02-06T06:42:35.79+00:00

    Hello @David Dong,Welcome to microsoft Q&A,Thankyou for posting your query here. The error message "unable to detect docker environment" typically indicates that the Batch node is not configured to run Docker containers. To run Docker containers on a Batch node, you need to install Docker and configure the Batch node to use the Docker engine. You can do this by creating a custom image that includes the Docker engine and using that image as the base image for your Batch pool. Install Docker on the base image. You can do this by downloading the Docker installer and running it in silent mode.

    FROM microsoft/dotnet-framework:4.7.2-sdk
    
    # Download and install Docker
    ADD https://download.docker.com/win/static/stable/x86_64/docker-18.09.3.zip C:\\docker.zip
    RUN powershell -Command Expand-Archive -Path C:\\docker.zip -DestinationPath C:\\ ; \
        Rename-Item -Path C:\\docker -NewName 'docker.exe' ; \
        Move-Item -Path C:\\docker.exe -Destination C:\\Windows\\System32\\docker.exe
    

    Build the custom image using the Docker command line docker build -t <image-name> . Use the custom image as the base image for your Batch pool. When creating the pool, specify the custom image as the imageReference and set the node Agent SKU Id to batch.node.windows amd64. az batch pool create \ --id mypool \ --vm-size Standard_D2_v2 \ --image-reference <image-name> \ --node-agent-sku-id "batch.node.windows amd64" \ --target-dedicated-nodes 1 \ --account-name mybatchaccount \ --account-endpoint https://mybatchaccount.region.batch.azure.com \ --access-key mybatchaccountkey Hope this helps you. please consider accepting the answer to help increase visibility of this question for other members of the Microsoft Q&A community. If not, please let us know what is still needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!.