Skip to content

Commit 0793ad7

Browse files
ndeloofglours
authored andcommitted
document support for OCI and Git remote resources
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 8137b2b commit 0793ad7

File tree

2 files changed

+103
-0
lines changed

2 files changed

+103
-0
lines changed

docs/reference/compose.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# docker compose
23

34
```text
@@ -126,6 +127,57 @@ get the postgres image for the db service from anywhere by using the `-f` flag a
126127
$ docker compose -f ~/sandbox/rails/compose.yaml pull db
127128
```
128129

130+
#### Using an OCI published artifact
131+
You can use the `-f` flag with the `oci://` prefix to reference a Compose file that has been published to an OCI registry.
132+
This allows you to distribute and version your Compose configurations as OCI artifacts.
133+
134+
To use a Compose file from an OCI registry:
135+
136+
```console
137+
$ docker compose -f oci://registry.example.com/my-compose-project:latest up
138+
```
139+
140+
You can also combine OCI artifacts with local files:
141+
142+
```console
143+
$ docker compose -f oci://registry.example.com/my-compose-project:v1.0 -f compose.override.yaml up
144+
```
145+
146+
The OCI artifact must contain a valid Compose file. You can publish Compose files to an OCI registry using the
147+
`docker compose publish` command.
148+
149+
#### Using a git repository
150+
You can use the `-f` flag to reference a Compose file from a git repository. Compose supports various git URL formats:
151+
152+
Using HTTPS:
153+
```console
154+
$ docker compose -f https://github.com/user/repo.git up
155+
```
156+
157+
Using SSH:
158+
```console
159+
$ docker compose -f [email protected]:user/repo.git up
160+
```
161+
162+
You can specify a specific branch, tag, or commit:
163+
```console
164+
$ docker compose -f https://github.com/user/repo.git@main up
165+
$ docker compose -f https://github.com/user/[email protected] up
166+
$ docker compose -f https://github.com/user/repo.git@abc123 up
167+
```
168+
169+
You can also specify a subdirectory within the repository:
170+
```console
171+
$ docker compose -f https://github.com/user/repo.git#main:path/to/compose.yaml up
172+
```
173+
174+
When using git resources, Compose will clone the repository and use the specified Compose file. You can combine
175+
git resources with local files:
176+
177+
```console
178+
$ docker compose -f https://github.com/user/repo.git -f compose.override.yaml up
179+
```
180+
129181
### Use `-p` to specify a project name
130182

131183
Each configuration has a project name. Compose sets the project name using

docs/reference/docker_compose.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,57 @@ examples: |-
290290
$ docker compose -f ~/sandbox/rails/compose.yaml pull db
291291
```
292292
293+
#### Using an OCI published artifact
294+
You can use the `-f` flag with the `oci://` prefix to reference a Compose file that has been published to an OCI registry.
295+
This allows you to distribute and version your Compose configurations as OCI artifacts.
296+
297+
To use a Compose file from an OCI registry:
298+
299+
```console
300+
$ docker compose -f oci://registry.example.com/my-compose-project:latest up
301+
```
302+
303+
You can also combine OCI artifacts with local files:
304+
305+
```console
306+
$ docker compose -f oci://registry.example.com/my-compose-project:v1.0 -f compose.override.yaml up
307+
```
308+
309+
The OCI artifact must contain a valid Compose file. You can publish Compose files to an OCI registry using the
310+
`docker compose publish` command.
311+
312+
#### Using a git repository
313+
You can use the `-f` flag to reference a Compose file from a git repository. Compose supports various git URL formats:
314+
315+
Using HTTPS:
316+
```console
317+
$ docker compose -f https://github.com/user/repo.git up
318+
```
319+
320+
Using SSH:
321+
```console
322+
$ docker compose -f [email protected]:user/repo.git up
323+
```
324+
325+
You can specify a specific branch, tag, or commit:
326+
```console
327+
$ docker compose -f https://github.com/user/repo.git@main up
328+
$ docker compose -f https://github.com/user/[email protected] up
329+
$ docker compose -f https://github.com/user/repo.git@abc123 up
330+
```
331+
332+
You can also specify a subdirectory within the repository:
333+
```console
334+
$ docker compose -f https://github.com/user/repo.git#main:path/to/compose.yaml up
335+
```
336+
337+
When using git resources, Compose will clone the repository and use the specified Compose file. You can combine
338+
git resources with local files:
339+
340+
```console
341+
$ docker compose -f https://github.com/user/repo.git -f compose.override.yaml up
342+
```
343+
293344
### Use `-p` to specify a project name
294345
295346
Each configuration has a project name. Compose sets the project name using

0 commit comments

Comments
 (0)