0
votes

I have been trying to deploy an IoT Edge module to my IoT Edge device using the following link:

https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-deploy-function

Everything appears to be working fine, however, when I right-click the deployment.template.json file and select Build IoT Edge solution I get the following output:

PS C:\Users\Carlton\Documents\OnAzureFunction\EdgeSolutionAF> docker build --rm -f "c:\Users\Carlton\Documents\OnAzureFunction\EdgeSolutionAF\modules\edgeonAzureF\Dockerfile.amd64" -t carlscontainer.azurecr.io/edgeonazuref:0.0.1-amd64 "c:\Users\Carlton\Documents\OnAzureFunction\EdgeSolutionAF\modules\edgeonAzureF" ; if ($?) { docker push carlscontainer.azurecr.io/edgeonazuref:0.0.1-amd64 } Sending build context to Docker daemon 12.29kB Step 1/3 : FROM mcr.microsoft.com/azureiotedge-functions-binding:1.0.0-linux-amd641.0.0-linux-amd64: Pulling from azureiotedge-functions-bindingimage operating system "linux" cannot be used on this platformPS C:\Users\Carlton\Documents\OnAzureFunction\EdgeSolutionAF>

As you can see Step 1/3 appears to fail.

error

What should happen is visual Studio Code first takes the information in the deployment template and generates a deployment.json file in a new config folder. Then it runs two commands in the integrated terminal: docker build and docker push. These two commands build your code, containerize the functions, and the push it to the container registry that you specified when you initialized the solution. However, as you can the docker push does not send it to the container registry.

1

1 Answers

1
votes

Which container is running on the docker host,Linux container or Windows contianer? You should switch the container to Linux Container(right click the docker icon in task bar -> Switch to Linux containers).

enter image description here