Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine Docker Compose Usage in Documentation #7290

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions remote/advancedcontainers/connect-multiple-containers.md

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,20 @@ The location of the `.git` folder is important, since we will need to ensure the
Next, assume the `docker-compose.yml` in the root is as follows:

```yaml
version: '3'
services:
python-api:
image: mcr.microsoft.com/devcontainers/python:1-3.12-bookworm
volumes:
# Mount the root folder that contains .git
- .:/workspace:cached
- .:/workspace
command: sleep infinity
links:
- node-app
# ...

node-app:
image: mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm
volumes:
# Mount the root folder that contains .git
- .:/workspace:cached
- .:/workspace
command: sleep infinity
# ...
```
Expand Down Expand Up @@ -80,7 +77,7 @@ Next, you can set up `./devcontainer/node-container/devcontainer.json` for Node.
}
```

The `"shutdownAction":"none"` in the `devcontainer.json` files is optional, but will leave the containers running when VS Code closes -- which prevents you from accidentally shutting down both containers by closing one window.
The `"shutdownAction": "none"` in the `devcontainer.json` files is optional, but will leave the containers running when VS Code closes -- which prevents you from accidentally shutting down both containers by closing one window.

## Connect to multiple containers in multiple VS Code windows

Expand Down Expand Up @@ -110,16 +107,15 @@ If you want to [extend your Docker Compose file for development](/docs/devcontai
For example, consider this `docker-compose.devcontainer.yml` file:

```yaml
version: '3'
services:
python-api:
volumes:
- ~:~/local-home-folder:cached # Additional bind mount
- ~:~/local-home-folder # Additional bind mount
# ...

node-app:
volumes:
- ~/some-folder:~/some-folder:cached # Additional bind mount
- ~/some-folder:~/some-folder # Additional bind mount
# ...
```

Expand Down