Build of IoT Edge Solution failing on Mac OS X with VS Code
See original GitHub issueHi,
I have created sample IoT Edge solution using C# module and able to build solution if select amd64 for linux or arm32v7.
This complete setup is on Mac OS X- 10.14.3
Below is the log for successful build-
docker build --rm -f "/Users/singh.prateek/Documents/usb_edge_module/samplesolution/modules/SampleModule/Dockerfile.amd64" -t localhost:5000/samplemodule:0.0.1-amd64 "/Users/singh.prateek/Documents/usb_edge_module/samplesolution/modules/SampleModule"
nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local"
Run `npm config delete prefix` or `nvm use --delete-prefix v8.1.3 --silent` to unset it.
AMAC02T82A5G8WL:samplesolution singh.prateek$ docker build --rm -f "/Users/singh.prateek/Documents/usb_edge_module/samplesolution/modules/SampleModule/Dockerfile.amd64" -t localhost:5000/samplemodule:0.0.1-amd64 "/Users/singh.prateek/Documents/usb_edge_module/samplesolution/modules/SampleModule"
Sending build context to Docker daemon 499.2kB
Step 1/12 : FROM microsoft/dotnet:2.1-sdk AS build-env
---> d14ca4022ef8
Step 2/12 : WORKDIR /app
---> Using cache
---> eb579a436ee1
Step 3/12 : COPY *.csproj ./
---> Using cache
---> 6545fdce6700
Step 4/12 : RUN dotnet restore
---> Using cache
---> 4c9957eecd3f
Step 5/12 : COPY . ./
---> Using cache
---> a6a8fe4644df
Step 6/12 : RUN dotnet publish -c Release -o out
---> Using cache
---> 1e6cc7003801
Step 7/12 : FROM microsoft/dotnet:2.1-runtime-stretch-slim
---> e1979bed16c6
Step 8/12 : WORKDIR /app
---> Using cache
---> 8b1e6764a5cc
Step 9/12 : COPY --from=build-env /app/out ./
---> Using cache
---> f0d0e8fdbccc
Step 10/12 : RUN useradd -ms /bin/bash moduleuser
---> Using cache
---> 81b8f8005ba8
Step 11/12 : USER moduleuser
---> Using cache
---> 1436a3d62862
Step 12/12 : ENTRYPOINT ["dotnet", "SampleModule.dll"]
---> Using cache
---> 76b283d4b4f3
Successfully built 76b283d4b4f3
Successfully tagged localhost:5000/samplemodule:0.0.1-amd64
Selected amd64 in status bar in bottom. Below is the screenshot-
I need to build a solution on Windows IoT Core but facing issue while building the code.
If i select to build the solution for windows.amd64. It get failed and build doesn’t get completed.
Facing the same issue on Windows 10 Enterprise with VS Code.
Below is the log for the same-
docker run -d -p 5000:5000 --restart always --name registry registry:2 docker build --rm -f “/Users/singh.prateek/Documents/usb_edge_module/samplesolution/modules/SampleModule/Dockerfile.windows-amd64” -t localhost:5000/samplemodule:0.0.1-windows-amd64 “/Users/singh.prateek/Documents/usb_edge_module/samplesolution/modules/SampleModule” nvm is not compatible with the npm config “prefix” option: currently set to “/usr/local” Run
npm config delete prefix
ornvm use --delete-prefix v8.1.3 --silent
to unset it. AMAC02T82A5G8WL:samplesolution singh.prateek$ docker run -d -p 5000:5000 --restart always --name registry registry:2 Unable to find image ‘registry:2’ locally 2: Pulling from library/registry c87736221ed0: Pull complete 1cc8e0bb44df: Pull complete 54d33bcb37f5: Pull complete e8afc091c171: Pull complete b4541f6d3db6: Pull complete Digest: sha256:3b00e5438ebd8835bcfa7bf5246445a6b57b9a50473e89c02ecc8e575be3ebb5 Status: Downloaded newer image for registry:2 5f1cbd7626cd41e7323b9fc863a373eff286b1a2202454c5aaa9f24b752fe302 AMAC02T82A5G8WL:samplesolution singh.prateek$ docker build --rm -f “/Users/singh.prateek/Documents/usb_edge_module/samplesolution/modules/SampleModule/Dockerfile.windows-amd64” -t localhost:5000/samplemodule:0.0.1-windows-amd64 “/Users/singh.prateek/Documents/usb_edge_module/samplesolution/modules/SampleModule” Sending build context to Docker daemon 499.2kB Step 1/10 : FROM microsoft/dotnet:2.1-sdk AS build-env —> d14ca4022ef8 Step 2/10 : WORKDIR /app —> Using cache —> eb579a436ee1 Step 3/10 : COPY *.csproj ./ —> Using cache —> 6545fdce6700 Step 4/10 : RUN dotnet restore —> Using cache —> 4c9957eecd3f Step 5/10 : COPY . ./ —> a6a8fe4644df Step 6/10 : RUN dotnet publish -c Release -o out —> Running in ac36c998ccba Microsoft ® Build Engine version 15.8.166+gd4e8d81a88 for .NET Core Copyright © Microsoft Corporation. All rights reserved.Restoring packages for /app/SampleModule.csproj… Installing WindowsAzure.Storage 9.3.2. Installing Microsoft.Azure.Amqp 2.4.1. Installing Microsoft.Azure.Devices.Shared 1.16.0. Installing Microsoft.Azure.Devices.Client 1.20.0. Generating MSBuild file /app/obj/SampleModule.csproj.nuget.g.props. Generating MSBuild file /app/obj/SampleModule.csproj.nuget.g.targets. Restore completed in 4.28 sec for /app/SampleModule.csproj. SampleModule -> /app/bin/Release/netcoreapp2.1/SampleModule.dll SampleModule -> /app/out/ Removing intermediate container ac36c998ccba —> 1e6cc7003801 Step 7/10 : FROM microsoft/dotnet:2.1-runtime-nanoserver-1809 2.1-runtime-nanoserver-1809: Pulling from microsoft/dotnet 9319e23c8670: Pulling fs layer 06115200a5ea: Pulling fs layer bfe004a217a3: Downloading [==============================> ] 501B/832B 62910792b602: Waiting 3438d488c839: Waiting a6068294d62b: Waiting image operating system “windows” cannot be used on this platform
Below is the screenshot for windows.amd64 selection in status bar-
Can you please let me know the root cause for this. I tried the same
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
@pratson20 If you want to work on MacOS and build Windows containers, there are two options.
I don’t think the Windows VM in Mac OS can support Hyper-V as this is a nested virtualization configuration.
You can try using the
--isolation=process
switch (link)