-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
bash associative array in .yml definition #3726
Comments
Arrays are not supported. Which document are you looking at? |
https://docs.docker.com/compose/compose-file/ search for "array" Thanks @aanand |
thinking about it: you have access to the shell environment so you can see it all, I guess: |
OK, I think we're talking about different things. What that document states is that YAML values for # as an array
environment:
- FOO=hello
- BAR=world
# as a dictionary
environment:
FOO: hello
BAR: world Environment variable interpolation, however, necessarily deals with strings, because environment variables can only be strings. This is true of all command-line tools, not just Compose. For example, $ FOO=hello
$ export FOO
$ env | grep FOO
FOO=hello $ FOO=(1 2 3)
$ export FOO
$ env | grep FOO
(no output) It's therefore not possible for Compose to understand Bash associative arrays. |
|
it might be totally my fault,
but a couple of fairly obvious syntax to retrieve a passed-in array is failing with an "Invalid interpolation format" error.
In the doc it says that arrays are supported. In my case, being tricky, I need to make use of the associative array (bash > v4)
Any hope for me?
thank you
The text was updated successfully, but these errors were encountered: