Skip to content

Conversation

@nVitius
Copy link
Contributor

@nVitius nVitius commented Oct 5, 2016

This feature was not supported previously, but
was added in docker/compose#3108

@aanand
Copy link
Contributor

aanand commented Oct 11, 2016

Thanks! We should document both forms of the inline default syntax:

  • ${VAR-default} (only fall back if VAR is unset)
  • ${VAR:-default} (fall back if VAR is unset or empty)

mdlinville pushed a commit that referenced this pull request Oct 11, 2016
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>
@johndmulhausen
Copy link
Contributor

Question: Is this for upcoming Docker Compose functionality or is this functionality already released?

@nVitius
Copy link
Contributor Author

nVitius commented Oct 11, 2016

@aanand: thanks, I missed that part.
@johndmulhausen: It looks like it's slated for 1.9.

@mdlinville
Copy link

In that case, please rebase this on the branch vnext-compose.

@nVitius nVitius force-pushed the var-interpolation-docs branch from 132b503 to bf39724 Compare October 12, 2016 16:48
@nVitius nVitius changed the base branch from master to vnext-compose October 12, 2016 16:49
This feature was not supported previously, but
was added in docker/compose#3108
@nVitius nVitius force-pushed the var-interpolation-docs branch from bf39724 to bb7661a Compare October 12, 2016 16:50
@nVitius
Copy link
Contributor Author

nVitius commented Oct 12, 2016

Okay, I rebased over the vnext-compose branch and added the comment regarding the different syntax.

Copy link

@mdlinville mdlinville left a 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

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".

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
Copy link

@mdlinville mdlinville Oct 12, 2016

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 VARIABLE is unset or empty:

    ${VARIABLE:-default}
    
  • To provide a default value if VARIABLE is empty:

    ${VARIABLE-default}

Both...

Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
@londoncalling
Copy link
Contributor

@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...?

@mdlinville
Copy link

LGTM, thought I would still reconsider "it is possible to"...

@londoncalling londoncalling merged commit 1676a84 into docker:vnext-compose Oct 31, 2016
@johndmulhausen johndmulhausen added this to the compose/1.9.0 milestone Nov 11, 2016
joaofnfernandes pushed a commit to joaofnfernandes/docker.github.io that referenced this pull request Aug 16, 2017
joaofnfernandes pushed a commit to joaofnfernandes/docker.github.io that referenced this pull request Aug 16, 2017
JimGalasyn pushed a commit that referenced this pull request Aug 16, 2017
shin- pushed a commit to shin-/docker.github.io that referenced this pull request Aug 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants