moby / moby/buildkit

Failure retrieving commit time with SOURCE_DATE_EPOCH set (`fork/exec /usr/bin/git: no such file or directory`)

Open
#7,151 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status/triage
Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 21h
Merged PRs (30d)
50

Description

Contributing guidelines and issue reporting guide
Well-formed report checklist
  • I have found a bug that the documentation does not mention anything about my problem
  • I have found a bug that there are no open or closed issues that are related to my problem
  • I have provided version/information about my environment and done my best to provide a reproducer
Description of bug

Bug description

When using git context with a subdir (<repo>.git#<ref>:<subdir>) and SOURCE_DATE_EPOCH is set, the build fails to get commit time for : git stderr: : fork/exec /usr/bin/git: no such file or directory.

ERROR: failed to build: failed to solve: failed to read dockerfile: failed to get commit time for https://github.com/moby/buildkit.git: git stderr:
: fork/exec /usr/bin/git: no such file or directory

Expected behaviour - no failure, buildkit is using passed SOURCE_DATE_EPOCH value.

Reproduction

docker buildx create --name repro --driver docker-container --use

# SOURCE_DATE_EPOCH set, failure
SOURCE_DATE_EPOCH=1700000000 docker buildx build --call check \
  "https://github.com/moby/buildkit.git#master:examples/create-certs"

# SOURCE_DATE_EPOCH unset, success
docker buildx build --call check \
  "https://github.com/moby/buildkit.git#master:examples/create-certs"

Version information

% docker --version
Docker version 29.8.0, build 88096ef

% docker buildx version       
github.com/docker/buildx v0.37.0 ac30b249211430b85fb8f37b6e7154b5c47ba0b6

Reference

  • #3565

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

Reproduce the failure with the provided docker buildx build command using a git context with a subdir and SOURCE_DATE_EPOCH set, then inspect the git-context handling for that combination. Done means the build completes without the fork/exec /usr/bin/git error and uses the passed SOURCE_DATE_EPOCH value.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, git, go
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.