|
| 1 | + |
1 | 2 | # docker compose |
2 | 3 |
|
3 | 4 | ```text |
@@ -126,6 +127,57 @@ get the postgres image for the db service from anywhere by using the `-f` flag a |
126 | 127 | $ docker compose -f ~/sandbox/rails/compose.yaml pull db |
127 | 128 | ``` |
128 | 129 |
|
| 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 | + |
129 | 181 | ### Use `-p` to specify a project name |
130 | 182 |
|
131 | 183 | Each configuration has a project name. Compose sets the project name using |
|
0 commit comments