docker / docker/buildx

buildx build produces git not found warning even with attestations disabled

Open
#1,881 7 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/cli
Dominant language
Go
Stars
4.5k
Forks
682
Avg merge
2d 14h
Merged PRs (30d)
29

Description

Contributing guidelines
I've found a bug and checked that ...
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem
Description

The WARNING: buildx: git was not found in the system. Current commit information was not captured by the build warning appears on systems without git installed even if attestations are disabled with --provenance=false and --sbom=false.

I'm presuming attestations are the cause, but there's no documentation for this warning and the documentation on just how attestations data is gathered is fairly threadbare. The fact that this warning gives no indication of why it's a problem and why buildx is complaining about not finding git and what to do to remedy the situation if git not being available is correct behaviour suggests that either the warning and/or documentation is inadequate.

Expected behaviour

If attestations are switched off, buildx shouldn't be trying to gather data for them.

Actual behaviour

Warning generated suggests that attestations data is being gathered regardless of whether it's enabled or not.

Buildx version

github.com/docker/buildx v0.10.4 c513d34049e499c53468deac6c4267ee72948f02

Docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx

Server:
 Containers: 3
  Running: 2
  Paused: 0
  Stopped: 1
 Images: 42
 Server Version: 24.0.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version: v1.1.7-0-g860f061
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.49-linuxkit-pr
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 3.841GiB
 Name: docker-desktop
 ID: a7556ca5-8fa3-4032-8a01-d9b50ca2c610
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 70
  Goroutines: 102
  System Time: 2023-06-14T18:19:57.576077242Z
  EventsListeners: 11
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Experimental: true
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false
Builders list
default * docker                                                        
  default default         running v0.11.7-0.20230525183624-798ad6b0ce9f linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
Configuration

Not applicable.

Build logs

No response

Additional info

Reproduced with a git source tree copied over to a minimal build system without git installed, then docker build ran.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the warning with docker build on a source tree copied to a system without git, using --provenance=false and --sbom=false. Read the buildx code path that gathers current commit information and emits the warning. Done means disabling attestations no longer triggers the warning, or the warning clearly explains the remaining behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
build-system, cli, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.