acr icon indicating copy to clipboard operation
acr copied to clipboard

az acr build specifying --platform linux/amd64 is not working

Open gvsireesh opened this issue 2 years ago • 8 comments

Describe the bug Hi Team, I'm trying to run az acr build task by passing parameter --platform linux/amd64, in the docker file we have FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/nightly/sdk:8.0-preview AS build the build command throws exception if I pass --parameter value. Please find the error below, when I remove platform from command and dockerfile the az acr build command works perfectly.

2023/06/12 02:28:23 Setting up Docker configuration... 2023/06/12 02:28:24 Successfully set up Docker configuration 2023/06/12 02:28:24 Logging in to registry: .azurecr.io 2023/06/12 02:28:25 Successfully logged into .azurecr.io 2023/06/12 02:28:25 Executing step ID: build. Timeout(sec): 28800, Working directory: '', Network: '' 2023/06/12 02:28:25 Scanning for dependencies... 2023/06/12 02:28:25 Output from dependency scanning: fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). unable to understand line FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/nightly/sdk:8.0-preview AS build

To Reproduce Steps to reproduce the behavior:

  1. az acr build --platform linux/amd64 --image <image_name>: -r -f .

Expected behavior A clear and concise description of what you expected to happen.

  1. I expected the build gets succeeded and an image created for platform linux/amd64

Any relevant environment information

  • OS: Windows
  • Azure CLI/PowerShell/SDK version - Azure CLI - 2.48.1
  • Docker version - Docker version 24.0.2, build cb74dfc
  • Datetime (UTC) when the issue occurred
  • Registry and image names

Additional context Add any other context about the problem here.

If any information is a concern to post here, you can create a support ticket or send an email to [email protected].

gvsireesh avatar Jun 12 '23 03:06 gvsireesh

Please open a support ticket with our team to investigate as this board is primarily used to provide roadmap updates. If you don’t have any additional questions here, this issue will close in 7 days. Thanks!

leodewang avatar Jun 12 '23 17:06 leodewang

We don't support the feature now

https://github.com/Azure/acr-builder/issues/449

northtyphoon avatar Jun 12 '23 18:06 northtyphoon

+1, we need this to enable Apple Silicon (Mac m1/m2) to do our hero AI samples like this one: azure-search-openai-demo-csharp/app/Dockerfile at main · coolcsh/azure-search-openai-demo-csharp · GitHub

paulyuk avatar Jul 10 '23 20:07 paulyuk

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Oct 06 '23 01:10 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Dec 06 '23 01:12 github-actions[bot]

Yes this is quite important for those of us on M1/2/3 macs because we need to put this in our Dockerfiles very often. If we're building something locally and pushing it, we often end up building for the wrong architecture without. It looks like the VSCode extension (with the referenced pull request above) simply replaces it with nothing -- could you do that on the Azure backend instead / in addition?

hut8 avatar Apr 04 '24 18:04 hut8