Skip to content

Commit f9640ef

Browse files
authored
Update/simplify some Docker Compose configuration examples (#7290)
1 parent 44026e7 commit f9640ef

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

remote/advancedcontainers/connect-multiple-containers.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,20 @@ The location of the `.git` folder is important, since we will need to ensure the
3535
Next, assume the `docker-compose.yml` in the root is as follows:
3636

3737
```yaml
38-
version: '3'
3938
services:
4039
python-api:
4140
image: mcr.microsoft.com/devcontainers/python:1-3.12-bookworm
4241
volumes:
4342
# Mount the root folder that contains .git
44-
- .:/workspace:cached
43+
- .:/workspace
4544
command: sleep infinity
46-
links:
47-
- node-app
4845
# ...
4946

5047
node-app:
5148
image: mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm
5249
volumes:
5350
# Mount the root folder that contains .git
54-
- .:/workspace:cached
51+
- .:/workspace
5552
command: sleep infinity
5653
# ...
5754
```
@@ -80,7 +77,7 @@ Next, you can set up `./devcontainer/node-container/devcontainer.json` for Node.
8077
}
8178
```
8279

83-
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.
80+
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.
8481

8582
## Connect to multiple containers in multiple VS Code windows
8683

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

112109
```yaml
113-
version: '3'
114110
services:
115111
python-api:
116112
volumes:
117-
- ~:~/local-home-folder:cached # Additional bind mount
113+
- ~:~/local-home-folder # Additional bind mount
118114
# ...
119115

120116
node-app:
121117
volumes:
122-
- ~/some-folder:~/some-folder:cached # Additional bind mount
118+
- ~/some-folder:~/some-folder # Additional bind mount
123119
# ...
124120
```
125121

0 commit comments

Comments
 (0)