Skip to content

Az acr build parses all files in repo even if excluded in .dockerignore #31250

@jzazo

Description

@jzazo

Describe the bug

I am trying to build a docker image with az acr build -t <repo/name:tag> -f Dockerfile -r <registry> . and I have a .dockerignore file with .venv in it. However az acr build parses all files within the dockerignore file, and it is very slow. It just does not ignore the folder, but parses every file within ignored folders. I don't think this should happen

Related command

az acr build -t <repo/name:tag> -f Dockerfile -r <registry> .

Errors

After more than 30min, I get an error:

Packing source code into tar to upload...
[Errno 2] No such file or directory: '.\\.venv\\bin\\python3.12'

Issue script & Debug output

Long logs of the form cli.azure.cli.command_modules.acr._archive_utils: .dockerignore: no rule for '.venv/lib/python3.12/site-packages/pyright/dist/dist/typeshed-fallback/stubs/TgCrypto'. parent ignore 'True'

Expected behavior

Running az acr build should be fast even if I am using a virtual environment

Environment Summary

azure-cli 2.71.0 core 2.71.0
telemetry 1.1.0 Extensions:
bastion 1.4.0
ssh 2.0.6 Dependencies:
msal 1.31.2b1
azure-mgmt-resource 23.1.1 Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users\javierzazo.azure'
Extensions directory 'C:\Users\javierzazo.azure\cliextensions' Python (Windows) 3.12.8 (tags/v3.12.8:2dc476b, Dec 3 2024, 19:30:04) [MSC v.1942 64 bit (AMD64)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Labels

Auto-AssignAuto assign by botContainer Registryaz acrPossible-SolutionService AttentionThis issue is responsible by Azure service team.Similar-Issueact-observability-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions