-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Document Compose's syntax for variable defaults #84
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
Document Compose's syntax for variable defaults #84
Conversation
|
Thanks! We should document both forms of the inline default syntax:
|
code is bind mounted into the development container. Otherwise in Task 3 changes made to the source code outside the container will not be visible inside the container. This is basically the change made by @mbtamuli in #84 but that change seems to have been abandoned. Signed-off-by: Dan Liew <daniel.liew@imperial.ac.uk>
|
Question: Is this for upcoming Docker Compose functionality or is this functionality already released? |
|
@aanand: thanks, I missed that part. |
|
In that case, please rebase this on the branch |
132b503 to
bf39724
Compare
This feature was not supported previously, but was added in docker/compose#3108
bf39724 to
bb7661a
Compare
|
Okay, I rebased over the |
mdlinville
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is looking good. I added a couple of style suggestions which I think may make this easier to understand. Please let me know what you think about these.
|
|
||
| Both `$VARIABLE` and `${VARIABLE}` syntax are supported. Extended shell-style | ||
| features, such as `${VARIABLE-default}` and `${VARIABLE/foo/bar}`, are not | ||
| In the case of environment variables that are not set, it is also possible to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider "you can" instead of "it is possible to".
compose/compose-file.md
Outdated
| Both `$VARIABLE` and `${VARIABLE}` syntax are supported. Extended shell-style | ||
| features, such as `${VARIABLE-default}` and `${VARIABLE/foo/bar}`, are not | ||
| In the case of environment variables that are not set, it is also possible to | ||
| define default values like so: `${VARIABLE:-default}`. In this case, Compose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider rewriting this a bit:
...define default values using one of the following syntax variants.
-
To provide a default value which will be used if
VARIABLEis unset or empty:${VARIABLE:-default} -
To provide a default value if
VARIABLEis empty:${VARIABLE-default}
Both...
Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
|
@mstanleyjones can you look at the updates I made here per your comments, and if this looks good, review and approve? Then either you or I can merge this...? |
|
LGTM, thought I would still reconsider "it is possible to"... |
This feature was not supported previously, but
was added in docker/compose#3108