# dev_container: Make volumes key and source key in volume mounts optional \(\#53137\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 909f6d12fcd355b3f790163927453443a8bad601

Requested commit: 909f6d12fcd355b3f790163927453443a8bad601

Commit: 909f6d12fcd355b3f790163927453443a8bad601

Tree: 2f3af00be916b5366ae5eb1bd3c0a8d15073d555

Author: Peter Siegel

Committer: GitHub

## Message

```
dev_container: Make volumes key and source key in volume mounts optional (#53137)

Fixes some issues concerning volume mounts in the `dev_container`
integration:
1. Docker Compose services that don't define a volumes key cause
deserialization to fail because the field was required. This field is
not strictly necessary, i.e. for other services in a docker compose
devcontainer configuration which the editor is not attached to.
1. Volume mounts where source or target is absent (e.g. `tmpfs` mounts
that only need a target) also fail to parse because both fields were
required. This makes the source key optional, matching the Docker
Compose spec.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] 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 devcontainer initialization erroneously requiring each service
to have a volumes key.
- Fixed devcontainer initialization erroneously requiring source keys
for all volume mounts.

---------

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

## Parents

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

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