question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker build failed on M1 Mac

See original GitHub issue
=> CACHED [eshop/basket.api:linux-latest build 36/41] RUN dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"                                                                      0.0s
 => CACHED [eshop/basket.api:linux-latest build 37/41] COPY . .                                                                                                                           0.0s
 => CACHED [eshop/basket.api:linux-latest build 38/41] WORKDIR /src/Services/Basket/Basket.API                                                                                            0.0s
 => CACHED [eshop/basket.api:linux-latest build 39/41] RUN export PROTOBUF_TOOLS_OS=linux                                                                                                 0.0s
 => CACHED [eshop/basket.api:linux-latest build 40/41] RUN export PROTOBUF_TOOLS_CPU=x64                                                                                                  0.0s
 => ERROR [eshop/basket.api:linux-latest build 41/41] RUN dotnet publish --no-restore -c Release -o /app                                                                                  2.6s
------
 > [eshop/basket.api:linux-latest build 41/41] RUN dotnet publish --no-restore -c Release -o /app:
#51 0.414 Microsoft (R) Build Engine version 16.11.1+3e40a09f8 for .NET
#51 0.414 Copyright (C) Microsoft Corporation. All rights reserved.
#51 0.414
#51 2.155   EventBus -> /src/BuildingBlocks/EventBus/EventBus/bin/Release/net5.0/EventBus.dll
#51 2.446   EventBusRabbitMQ -> /src/BuildingBlocks/EventBus/EventBusRabbitMQ/bin/Release/net5.0/EventBusRabbitMQ.dll
#51 2.466   EventBusServiceBus -> /src/BuildingBlocks/EventBus/EventBusServiceBus/bin/Release/net5.0/EventBusServiceBus.dll
#51 2.566 /root/.nuget/packages/grpc.tools/2.34.0/build/_protobuf/Google.Protobuf.Tools.targets(84,5): error : Google.Protobuf.Tools cannot determine host OS and CPU. [/src/Services/Basket/Basket.API/Basket.API.csproj]
#51 2.566 /root/.nuget/packages/grpc.tools/2.34.0/build/_protobuf/Google.Protobuf.Tools.targets(84,5): error : Use environment variables PROTOBUF_TOOLS_OS={linux|macosx|windows} and PROTOBUF_TOOLS_CPU={x86|x64} to try the closest match to your system. [/src/Services/Basket/Basket.API/Basket.API.csproj]
#51 2.566 /root/.nuget/packages/grpc.tools/2.34.0/build/_protobuf/Google.Protobuf.Tools.targets(84,5): error : You may also set PROTOBUF_PROTOC to specify full path to the host-provided compiler (v3.5+ is required). [/src/Services/Basket/Basket.API/Basket.API.csproj]
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c dotnet publish --no-restore -c Release -o /app]: exit code: 1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
Mart112358commented, Feb 22, 2022

Hello,

Based on the comments in this thread and playing around with my M1 pro, I think I was able to make everything work.

I was able to authenticate with the demo user and create orders for both the SPA and MVC apps.

I also ran the unit/functionnal tests and everything passed.

What I did:

  • Docker: Replace MSSQL image by Azure SQL Edge
  • Docker: Update envoy proxy to 1.16.0 (first version with ARM64 images)
  • Update Grpc* references to the latest version

See the changes here: https://github.com/Mart112358/eShopOnContainers/tree/fix/1771

4reactions
SofianeBranecicommented, Oct 22, 2021

Hello @sughosneo, I just tried the steps above, and the issue is not resolved. I’m on macOS BigSur, M1 chip.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why new Macs break your Docker build, and how to fix it
So it can be a little confusing when you try to build your Python-based Dockerfile on a new Mac, and everything starts failing....
Read more >
Build Error on apple silicon M1 with docker - python
I was trying to dockerize a flask application with a third-party cli (plastimatch) on my M1. I used ubuntu:18.04 as base image. The...
Read more >
[BUG] docker compose build fails on Apple Silicon M1 Mac ...
After upgrading docker desktop to 4.16.2 with docker compose 2.15.1 docker compose build no longer works on our Apple Silicon Macs. Testing with ......
Read more >
Apple m1 makes your Docker build failed? | by Angus Hsu
When you try to run an image which is pulling from docker like node:14-slim , it'll automatically pull the architect which your machine...
Read more >
Dockerfile working on Linux but not on Mac M1 : r/docker
Hi, i don't pretend to understand that much of Docker but i cannot understand why my Dockerfile works without an issue on Linux...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found