Azure / acr

Azure Container Registry samples, troubleshooting tips and references
https://aka.ms/acr
Other
162 stars 106 forks source link

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

Open gvsireesh opened 1 year ago

gvsireesh commented 1 year ago

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 : -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

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 acrsup@microsoft.com.

leodewang commented 1 year ago

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!

northtyphoon commented 1 year ago

We don't support the feature now

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

paulyuk commented 1 year ago

+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

github-actions[bot] commented 9 months ago

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] commented 7 months ago

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.

hut8 commented 3 months ago

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?