Contributing guidelines and issue reporting guide
Well-formed report checklist
Description of bug
Bug description
When using docker/setup-buildx-action@v4 + docker/bake-action@v7 in GitHub Actions, a build context that points to a subdirectory containing Git LFS-tracked files gets resolved by BuildKit as a remote git context. This bypasses Git LFS smudge filters and exposes pointer files (containing "version https://git-lfs.github.com/spec/v1") inside the build context, causing builds to fail when Dockerfiles detect pointer files.
Environment
- Workflow: https://github.com/zeckson/mykapitel.ru (.github/workflows/smoke-test.yml)
- Actions: actions/checkout@v6 (with lfs: true), docker/setup-buildx-action@v4, docker/bake-action@v7
- Works with: setup-buildx-action@v3 + bake-action@v5
Reproduction steps
- Use actions/checkout@v6 with lfs: true so runner workspace has smudged LFS files.
- Set up buildx using docker/setup-buildx-action@v4 and invoke docker/bake-action@v7 with context pointing to a subdirectory (e.g., ./docker).
- BuildKit/bake resolves the subdirectory context via a remote git fetch which returns raw Git LFS pointer files instead of smudged objects.
Expected
- When the runner workspace already has LFS objects checked out, bake/buildx should use the local smudged files for a local workspace context or offer a clear option to force local context usage so builds do not inadvertently use remote git checkouts that skip smudge filters.
Observed
- The file seen inside the build context is a Git LFS pointer and the build fails (example: "Error: akeeba-backup.zip is a Git LFS pointer, not the actual file.").
Failure log excerpt
- COPY docker/akeeba-backup.zip /tmp/backup.zip
- RUN if grep -q "version https://git-lfs.github.com/spec/v1" /tmp/backup.zip; then echo "Error: akeeba-backup.zip is a Git LFS pointer, not the actual file." && exit 1; fi && unzip -t /tmp/backup.zip && unzip /tmp/backup.zip -d /app && rm /tmp/backup.zip
Additional info
I can provide the exact workflow file, Dockerfile from the failing run, or open a minimal repro PR if that helps.
Contributing guidelines and issue reporting guide
Well-formed report checklist
Description of bug
Bug description
When using docker/setup-buildx-action@v4 + docker/bake-action@v7 in GitHub Actions, a build context that points to a subdirectory containing Git LFS-tracked files gets resolved by BuildKit as a remote git context. This bypasses Git LFS smudge filters and exposes pointer files (containing "version https://git-lfs.github.com/spec/v1") inside the build context, causing builds to fail when Dockerfiles detect pointer files.
Environment
Reproduction steps
Expected
Observed
Failure log excerpt
Additional info
I can provide the exact workflow file, Dockerfile from the failing run, or open a minimal repro PR if that helps.