Closed pierreozoux closed 5 years ago
Would also help not over-engineering something. I have to use Docker configs for snippets of configuration when really it would be easier/portable in a single YAML file.
So for configs you could have something as follows:
version: '3.3'
services:
postgresql:
image: postgresql
configs:
- target: /postrgresql_config
uid: '103'
gid: '103'
mode: 0440
content: |
myconfig: $(YOU)
value: $(CAN)
other: $(TEMPLATIZE)
@shin- Hi, any solution ?
@Fridus Check out https://github.com/docker/app !
Issue grooming: I think I agree with @shin- that this sounds more like a docker-app thing.
+1
I'd like that, too!
Me too here :(
Inline files would also make it much easier to run docker compose on a remote host. Since docker app isn't a thing anymore, maybe reconsider closing this issue?
Would like that too... k8s offers that as well, would like to see it in docker compose.
Bumping this, hard to believe it's not a thing, would be extremely useful.
+1. This would be useful.
Any info on this?
https://github.com/compose-spec/compose-spec/issues/346
Please upvote if you'd like to see this implemented
This is available in Docker Compose version 2.23.1
now.
name: config-inline
services:
service:
image: ubuntu
entrypoint: cat
command: /path/to/config.txt
configs:
- source: config.txt
target: /path/to/config.txt
configs:
config.txt:
content: |
strawberry fields forever
Output:
$ docker-compose up
[+] Building 0.0s (0/0) docker:default
[+] Running 2/0
✔ Network config-inline_default Created 0.0s
✔ Container config-inline-service-1 Created 0.0s
Attaching to service-1
service-1 | strawberry fields forever
service-1 exited with code 0
This is great, and will make many deployments much simpler and cleaner. Thank you @ndeloof!
This is super great! I've been waiting for this for so long :D I've updated compose and works great.
However the I was a bit disappointed to discover that the spec does not yet seem to be available on swarm deploy, on engine 25.0.1
. https://github.com/compose-spec/compose-spec/issues/346#issuecomment-1826282162
Hello @sergioisidoro
Swarm isn't supported by Docker anymore but by Mirantis, maybe you could open an issue into the moby/moby
project
Thanks @glours , I opened a issue in a sort of hail Mary :) from what I see from Mirantis' website, their focus seems to be mainly on Kubernetes, with no mention of swarm as a solution. I'm afraid this is going towards a dead end.
I create a lot of compose file that I hope are useful for the community. I'd like to find a way for docker to officially ship these compose files.
There is one issue that IMHO is blocking us of doing so, is the ability to ship a file in docker-compose. Indeed, what distinguish a
piwik
from anownCloud
from aWordPress
compose file is only the nginx configuration.There are 3 way that I know to ship this configuration:
The first option: a file on the host:
The second option: the current inline way:
A bit dirty
The 3rd way: inline file
And so, I'm sure you see the value to have a proper way to add inline file.
The syntax could be similar to what cloudinit does.
With this, it would become easier to ship one compose file with everything included to get started an app!