Skip to content

[Fix #4493] Support for Required Environment Variables#4762

Closed
eliat123 wants to merge 0 commit into
docker:masterfrom
eliat123:master
Closed

[Fix #4493] Support for Required Environment Variables#4762
eliat123 wants to merge 0 commit into
docker:masterfrom
eliat123:master

Conversation

@eliat123
Copy link
Copy Markdown

This is my first PR.

I have added support for required environment variables - issue #4493.
Required environment variables are regular environment variables ending with '?'.

Whenever a required environment variable is written in docker-compose configuration: for example:

volumes:
  - ${MISSING?}:/app/code
environment:
  - MISSING?

we get an error message such as:

ERROR: Invalid interpolation format for "volumes" option in service "web": "${MISSING?}:/app/code" caused by required environment variable "MISSING" not set

and

ERROR: environment variable "MISSING?" is required

Please note:

  • All tests are passing and added new tests for this feature.
  • Did not find a version to place this in the changelog.md
  • Documentation is on a different repo, I will add it once I get approval for this PR.
  • Tried to follow @rsynnest suggestions to implement this feature.

@GordonTheTurtle
Copy link
Copy Markdown

Please sign your commits following these rules:
https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "master" git@github.com:eliat123/compose.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

@eliat123
Copy link
Copy Markdown
Author

I have recommitted my work as previous jenkins build was stuck, andrewhsu@docker.com has asked me to re-trigger a commit to initialize the build process.

@eliat123
Copy link
Copy Markdown
Author

eliat123 commented Apr 28, 2017

FYI, I have accidentally removed my changes from my fork and this caused this issue to close, I have re-merged the fix on #4778

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.

2 participants