docker-compose using buildkit fails to fetch local images (already existing or build by another service)

Open
#4,162 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, docker-compose, go

Research direction

Start with the linked simple reproducer and inspect its docker-compose.yml, Dockerfile.base, and Dockerfile.project. Run the reproducer with BuildKit enabled and trace how the run-app service resolves the image produced by build-app; done means local or sibling-service images are fetched successfully without disabling BuildKit.

Written by the indexing model from the issue text.

Description

docker-compose using buildkit fails to fetch local images (already existing or build by another service).

This bug obviously has been discussed here:
https://github.com/docker/compose/issues/3660

I'm still having the issue and found this thread! I don't think disabling Buildkit is a smart hack if one wants to use buildkit-features like COPY --chmod=a+x

The matter that buildkit obviously breaks this is a bug. Has this been reported to buildkit or is the bug located in docker itself?

example:


services:
  build-app:
     image: my-app-base
      context: .
      dockerfile: ./Dockerfile.base
      target: base-image

    run-app:
      image: my-app-project
      build:
        context: .
        dockerfile: ./Dockerfile.project
        target: base-image

FROM my-app-base AS my-project-app

Update
A simple reproducer:
https://github.com/Gabriel-Kaufmann/reproducer-docker-compose-buildx-issue

Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 23h
Merged PRs (30d)
48

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from moby/buildkit

All issues in moby/buildkit

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.