Failure retrieving commit time with SOURCE_DATE_EPOCH set (`fork/exec /usr/bin/git: no such file or directory`)
Open
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
- I've read the contributing guidelines and wholeheartedly agree. I've also read the 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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