## TL;DR

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.

## Steps

1. 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.

2. _Source: https://github.com/earthly/earthly/issues/3164 (Earthly)_

## When to use

You are seeing this: WORKDIR /root before the COPY of the compose file. Use this skill when you run into "WITH DOCKER using compose gives "Project name not found"".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/earthly/earthly/issues/3164
