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
Configs now work without swarm? #8707
Comments
swarm is not required nor supported, Compose V2 is for "standalone" docker engine. |
ran a quick test: services:
test:
image: alpine
command: cat /my_config
configs:
- my_config
configs:
my_config:
file: ./config_data $ echo "hello world" > config_data
$ docker compose up
[+] Running 1/0
⠿ Container truc-test-1 Created 0.0s
Attaching to truc-test-1
truc-test-1 | hello world
truc-test-1 exited with code 0 Please better describe your issue |
Oh, this is great news. I was under the impression that only Swarm Mode supported them as well. Things have changed in However, it would be nice if it didn't use bind mounts as described in related issues, and one could use them with a remote server:
EDIT: for the reference,
|
I'm very happy to see this feature available in docker-compose without swarm ! I'd really like to use some Golang templates to generate config files based on environment variables (and get ride of my python script that do exactly the same). However, I would also like to have a confirmation that this feature is not a bug and that we can rely on it not only today but also in the future. The docker documentation have still a note that say that they only available in Swarm : https://docs.docker.com/engine/swarm/configs/#about-configs |
After a try, it seem that template_driver (TemplateDriver) is ignored. The container bind mount the template file on destination without interpret it. Will that be supported in the future ? |
@gauthierl Configs are documented in the Compose spec, so it seems they should continue to be supported in Docker Compose V2? |
docker-compose, both v1 and v2, support |
Thanks for the clarification. It would be really convenient for production (or any use of a remote Docker Engine) if Docker Compose could somehow work around this; e.g., creating an anonymous volume, copying a specified config/secret file to the volume, and (somehow) mount just the file from the volume at the specified path in the service container. I'm happy to submit an issue if a similar feature request hasn't already been discussed and shot down :-) |
Thanks for the clarification @ndeloof ! I'm agree with @nathanweeks it would be an interesting feature :) But, I would also understand that it's over the scope of what compose should do. |
Being able to create a volume with some initial content is an interesting idea. Could maybe be feasible with some volume driver options? Anyway, this is not limited to config/secrets, which only make sense when the actual engine has support for such concepts (the way it was introduced in docker-compose is only a hack for smooth local developer experience while targeting swarm for production) |
It looks like configs are working without swarm (mabye secrets too?). I didn't see anything in the changelogs describing this.
There's no mention of swarm in the docs now either: https://docs.docker.com/compose/compose-file/compose-file-v3/#configs-configuration-reference
This is a welcome change, but I want to confirm, is this behavior intended and should we depend on it?
Related issues:
The text was updated successfully, but these errors were encountered: