Skip to content

[BUG] docker compose build fails: .git not found in build context (regression from 1.0.0) #1702

Description

@nilbot

Summary

Following server/README_EN.md step docker-compose up --build -d (from a clean state, no cached layers) fails on the API image build:

> [stage-0 14/14] RUN --mount=type=bind,source=.git,target=/tmp/.git \
      echo "EIGENT_SERVER_GIT_COMMIT=$(git --git-dir=/tmp/.git log -1 --format=%H -- server/ 2>/dev/null || echo unknown)" > /app/.image_env:
------
failed to solve: failed to compute cache key: failed to calculate checksum of ref ...: "/.git": not found

Root cause

A regression introduced in the 1.0.0 release.

  • server/Dockerfile:66 (added in PR feat: detect stale local server and notify developer to restart #1517, March 2026) bind-mounts .git from the build context to stamp the server commit into the image:
    RUN --mount=type=bind,source=.git,target=/tmp/.git \
        echo "EIGENT_SERVER_GIT_COMMIT=$(git --git-dir=/tmp/.git log -1 ...)" > /app/.image_env
  • .dockerignore was added new in commit 97d7554 (release: Eigent 1.0.0, PR release: Eigent 1.0.0 #1695) and excludes .git:
    # Source control
    .git
    .gitignore
    .gitattributes
    
  • BuildKit honors .dockerignore for --mount=type=bind sources, so the bind mount cannot find .git in the context and the build fails.

This was likely not caught pre-merge because cached image layers from before .dockerignore was added masked the failure on maintainer machines. A fresh clone + first build hits it immediately.

Reproduction

git clone https://github.com/eigent-ai/eigent.git
cd eigent/server
cp .env.example .env
docker compose build --no-cache api   # or `docker compose up --build -d`

Environment

  • macOS (Darwin 25.5.0), Docker Desktop with BuildKit enabled (default)
  • Tag: 1.0.0 (commit 97d7554)

Fix

Stop ignoring .git in .dockerignore. The bind mount means .git is never baked into a layer, only made available during the build step. PR to follow.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions