compose icon indicating copy to clipboard operation
compose copied to clipboard

Adding support for https-based remote URL addresses in docker compose.

Open acdiost opened this issue 2 years ago • 3 comments

Description

Docker Compose currently does not support loading docker-compose files from https URLs, which makes it inconvenient for developers to manage container orchestration through remote URL addresses.

To improve the usability and convenience, it is required to make necessary improvements to Docker Compose tool to support loading docker-compose files from remote https URLs.

docker compose -f https://xxx.yaml up -d

kubectl apply -f https://xxx.yaml

acdiost avatar Mar 09 '23 14:03 acdiost

That's an interesting proposal. Being able to share compose files without the need to first copy/clone source is a common user request. An issue to address here is about the way we would resolve relative paths in a compose file as there's no project directory defined. Shall those be considered URL-relative resources to be download, or just disable support for file paths?

For a compose.yaml file available over http there's anyway a trivial workaround to just run

curl https://xxx.yaml | docker compose -f - up -d

Also see related proposal to publish compose applications (both definition and images) on a registry https://github.com/compose-spec/compose-spec/issues/288

ndeloof avatar Mar 10 '23 07:03 ndeloof

for reference, implementation of -f flag in kubectl relies on https://github.com/kubernetes/cli-runtime/blob/master/pkg/resource/builder.go#L242

ndeloof avatar Mar 10 '23 07:03 ndeloof

When using docker inspect path and URL information is included. If using docker compose -f https://xxx.yaml up -d , the volumes field in the docker-compose.yaml file warns users to use either absolute paths or volume data instead.

acdiost avatar Mar 11 '23 02:03 acdiost