Azure-docs: Can't run az acr build locally as in quickstart

Created on 19 Apr 2019  Â·  7Comments  Â·  Source: MicrosoftDocs/azure-docs

Hey @dlepow,

Everything works fine on cloud shell but I can't get the build command to succeed locally on my machine running version 2.0.58 of Azure CLI.

R:\temp\acr> az acr build --image sample/hello-world:v2 --registry myContainerRegistry888 --file Dockerfile .
Packing source code into tar to upload...
Uploading archived source code from 'C:\Users\dlbm3\AppData\Local\Temp\build_archive_d2da04683d3d46488e86a140aa46e9d1.tar.gz'...
Sending context (260.000 Bytes) to registry: myContainerRegistry888...
Queued a build with ID: ca2
Waiting for agent...
2019/04/19 19:05:24 Using acb_vol_21a6cb48-e530-4868-b716-371d19b188a4 as the home volume
2019/04/19 19:05:24 Setting up Docker configuration...
2019/04/19 19:05:25 Successfully set up Docker configuration
2019/04/19 19:05:25 Logging in to registry: mycontainerregistry888.azurecr.io
2019/04/19 19:05:26 Successfully logged into mycontainerregistry888.azurecr.io
2019/04/19 19:05:26 Executing step ID: build. Working directory: '', Network: ''
2019/04/19 19:05:26 Obtaining source code and scanning for dependencies...
2019/04/19 19:05:27 Output from dependency scanning: unexpected dockerfile format
failed to run step ID: build: failed to scan dependencies: exit status 1

Run ID: ca2 failed after 5s
Run failed

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

container-registrsvc cxp product-question triaged

Most helpful comment

Found the issue. My file was encoded as "UTF-16 LE" When I changed to UTF-8 everything works now. Not sure how I set it to UTF-16 but that seems to be the culprit.

All 7 comments

Thanks for the question. We are currently investigating and will update you shortly.

@DarqueWarrior I think you have used command prompt to create the dockerfile in this step.

When you execute this commandecho "FROM hello-world" > Dockerfile to create a dockerfile in command prompt, it writes the double quotes also into the Dockerfile.

You can fix this with two options.

  • use powershell or the text editors to create that docker file.
  • use the command like this without double quotes echo FROM hello-world > Dockerfile in command prompt

Cloud shell is recommended for Azure CLI.

@DarqueWarrior @jakaruna-MSFT - This is a good case to cover in the docs, so thanks for raising. I tested a simpler echo command without quotes that seems to work fine across shells, so I'm updating the doc accordingly. Thanks!

please-close

@DarqueWarrior Thanks for bringing this to our attention. We will now close this issue. If there are further questions regarding this matter, please tag me in a comment. I will reopen it and we will gladly continue the discussion.

Sorry for the delay I was at a conference. I just checked my file and it did not have the quotes. I was using PowerShell to follow along. I will do some more testing and see if I can track down what the problem is.

Found the issue. My file was encoded as "UTF-16 LE" When I changed to UTF-8 everything works now. Not sure how I set it to UTF-16 but that seems to be the culprit.

Thanks for the update @DarqueWarrior

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

Favna picture Favna  Â·  3Comments

JamesDLD picture JamesDLD  Â·  3Comments

varma31 picture varma31  Â·  3Comments

bityob picture bityob  Â·  3Comments