# dev_container: Preserve build context for docker-compose Dockerfiles \(\#53140\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/dee42503c7024cb7e5374798379b9e12480000ce)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: dee42503c7024cb7e5374798379b9e12480000ce

Requested commit: dee42503c7024cb7e5374798379b9e12480000ce

Commit: dee42503c7024cb7e5374798379b9e12480000ce

Tree: 8dae3b4b4bd7ddadfbdfdd4816e9898a31f88b52

Author: Peter Siegel

Committer: GitHub

## Message

```
dev_container: Preserve build context for docker-compose Dockerfiles (#53140)

When a Docker Compose service specifies a build context, the generated
override file was replacing it with an empty context directory. This
meant Dockerfiles that reference files relative to their build context
(e.g. `COPY . /app`) would fail. The fix preserves the original build
context from the compose service, falling back to the empty context
directory only when no context was specified.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed docker compose Dockerfile build context not being preserved in
dev_container integration.

---------

Co-authored-by: KyleBarton <kjb@initialcapacity.io>
```

## Parents

- [136e91a7d325fcafe8534b56e5ef2e3bf6111b04](https://git.cafe/gitcafe/zed/commit/136e91a7d325fcafe8534b56e5ef2e3bf6111b04?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/dee42503c7024cb7e5374798379b9e12480000ce?format=markdown)
