Failure retrieving commit time with SOURCE_DATE_EPOCH set (`fork/exec /usr/bin/git: no such file or directory`)
Author: t3miCreated Sep 15, 2026Updated Sep 16, 2026
Labelsstatus/triage
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 directoryExpected 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 ac30b249211430b85fb8f37b6e7154b5c47ba0b6Reference
- #3565
Source: moby/buildkit