Skip to content

'ambiguous argument' git warning #1633

@dgageot

Description

@dgageot

When building an image in a git folder, it's possible to see such warning:

WARNING: failed to get git commit: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

To reproduce:

  • Create a folder
  • Run git init
  • Don't commit anything
  • Run echo "FROM scratch" | BUILDX_GIT_LABELS=full docker buildx build -f- .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions