8000 [Bug]: Docker build context appears empty for Docker Compose build, causing COPY to fail with "no such file or directory" · Issue #6002 · coollabsio/coolify · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[Bug]: Docker build context appears empty for Docker Compose build, causing COPY to fail with "no such file or directory" #6002
Open
@alnaggar-dev

Description

@alnaggar-dev

Error Message and Logs

Coolify Version: v4.0.0-beta.416 (Cloud)
Source: GitHub
Build Pack: Docker Compose

Description:
When deploying an application from a GitHub repository using the Docker Compose build pack, the build context provided to docker build appears to be completely empty. This causes any COPY instruction in the associated Dockerfile to fail with a "no such file or directory" error, even though the files are confirmed to exist in the root of the GitHub repository.

This issue persists even after deleting and recreating the application, confirming it's not a "stuck" configuration related to persistent volumes or the Base Directory setting.

Steps to Reproduce

This issue can be reliably reproduced using a fork of the official OpenLiteSpeed Docker environment.

  1. Fork the Repository: Fork the following repository: https://github.com/litespeedtech/ols-docker-env
  2. Create litespeed.dockerfile: In the root of the forked repository, create a litespeed.dockerfile with the following content. This file will be used to build a custom image for one of the services.

Dockerfile

FROM alpine:latest

# Attempt to COPY a directory that is known to exist in the repository root.
COPY ./lsws/conf /temp
  1. Create docker-compose.yml: In the root of the repository, create a minimal docker-compose.yml that uses the build directive.

YAML

services:
  litespeed:
    build:
      context: .
      dockerfile: litespeed.dockerfile
    ports:
      - "80"
  1. Configure in Coolify:
  • Create a new Application in Coolify using the forked GitHub repository.

  • Ensure the Build Pack is set to Docker Compose.

  • Ensure the Base Directory is set to /.

  1. Deploy: Trigger a deployment.

Expected Behavior
The Docker build process should start, and the COPY ./lsws/conf /temp command should succeed because the lsws/conf directory exists in the build context (the root of the repository).

Actual Behavior
The deployment fails during the docker build step. The log shows a clear error indicating that the source directory for the COPY command cannot be found.

Error Log Snippet

#5 [litespeed 2/2] COPY ./lsws/conf /temp
#5 ERROR: failed to calculate checksum of ref [...]: failed to walk /var/lib/docker/tmp/buildkit-mount.../lsws: lstat /var/lib/docker/tmp/buildkit-mount.../lsws: no such file or directory

failed to solve: failed to compute cache key: failed to calculate checksum of ref [...]: failed to walk /var/lib/docker/tmp/buildkit-mount.../lsws: lstat /var/lib/docker/tmp/buildkit-mount.../lsws: no such file or directory

Troubleshooting Steps Taken
We have undertaken extensive troubleshooting to isolate the cause, ruling out common configuration errors:

  • Confirmed the main branch on GitHub contains the correct file structure.
  • Confirmed there is no .dockerignore file causing exclusions.
  • Attempted to use an entrypoint with ls -laR in the running container. Initially, this showed an empty directory, which we believed was due to a conflict with Coolify's Persistent Storage feature.
  • Deleted the Application and all associated Persistent Volumes and recreated it from scratch to ensure a clean state. The issue persists.
  • Simplified the docker-compose.yml and Dockerfile to the absolute minimum (as shown in the reproduction steps), proving the failure is isolated to the build context itself.

Conclusion
The evidence strongly suggests an issue with how the Coolify build process prepares or provides the Git repository contents as the build context to the Docker daemon. The context appears to be empty or incomplete, leading to build failures.

Is there a known issue that could cause this behavior, or is there a recommended workaround for projects that require using a build directive in docker-compose.yml to copy files from the repository?

Thank you for your time and assistance.

Example Repository URL

No response

Coolify Version

v4.0.0-beta.416

Are you using Coolify Cloud?

Yes (Coolify Cloud)

Operating System and Version (self-hosted)

Ubuntu 22.04

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 BugReported issues that need to be reproduced by the team.🔍 TriageIssues that need assessment and prioritization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0