Azure / Azure/acr

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

Open
#697 9 comments 1 reaction 1 assignee Assigned to @toddysm View on GitHub
feature-acr-tasks feature-request triaged
Dominant language
No language data
Stars
177
Forks
137
PR merge metrics
No merged PRs in 30d

Description

**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 .
2.
3.

**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](https://azure.microsoft.com/en-us/support/create-ticket/) or send an email to acrsup@microsoft.com.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.