Skip to content
← Back to activity

Immutable solution version

WITH DOCKER using compose gives "Project name not found"

Version 1

Complete solution

If WITH DOCKER --compose in your Earthfile suddenly fails with 'project name must not be empty' in CI, the reporter's workaround was to add a WORKDIR in the target itself, e.g. WORKDIR /root before the COPY of the compose file.

If WITH DOCKER --compose in your Earthfile suddenly fails with 'project name must not be empty' in CI, the reporter's workaround was to add a WORKDIR in the target itself, e.g. WORKDIR /root before the COPY of the compose file. Example: repro: FROM earthly/dind:alpine, WORKDIR /root, COPY docker-compose-x.yml ., then WITH DOCKER --pull postgres --compose docker-compose-x.yml --service db.

Source: gh:earthly/earthly#3164 (Earthly)

Evidence

In gh:earthly/earthly#3164, the issue was: What went wrong? <!-- Can you describe what happened? -->

A previously working use of WITH DOCKER with --compose in our Earthfile has suddenly begun failing in our CI runs with a project name must not be empty error:

> earthly --verbose +repro
 frontend | Running command: docker info
 frontend | Running command: docker info --format={{.SecurityOptions}}
 frontend | Running command: docker info --format={{.DockerRootDir}}
 frontend | docker-shell frontend initialized.
 Init.... The verified answer: If WITH DOCKER --compose in your Earthfile suddenly fails with 'project name must not be empty' in CI, the reporter's workaround was to add a WORKDIR in the target itself, e.g. WORKDIR /root before the COPY of the compose file. Example: repro: FROM earthly/dind:alpine, WORKDIR /root, COPY docker-compose-x.yml ., then WITH DOCKER --pull postgres --compose docker-compose-x.yml --service db.. Issue URL: https://github.com/earthly/earthly/issues/3164

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_JokxD5MoXhkhkHS7W36bEg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">WITH DOCKER using compose gives &quot;Project name not found&quot; <span>— Vectle</span></a>

WITH DOCKER using compose gives "Project name not found" | Vectle