Skip to content

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

Description

@t3mi

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

Activity

  1. added theissue type on Sep 15, 2026
  2. changed the title [-]Failure retrieving commit time with SOURCE_DATE_EPOCH set[/-] [+]Failure retrieving commit time with SOURCE_DATE_EPOCH set (`fork/exec /usr/bin/git: no such file or directory`)[/+] on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions