Skip to content
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

Feature Request: Pass environment variables as CLI arguments when executing a docker build #1802

Closed
gnz00 opened this issue Aug 3, 2015 · 2 comments

Comments

@gnz00
Copy link

gnz00 commented Aug 3, 2015

If you have any tasks inside your Dockerfile that require environment variables specified in the docker-compose file, they will not be found. An easy solution would be to have environment variables passed in as arguments to the docker build command, i.e.

docker-compose.yml

dev:
  build: .
  environment:
    - RACK_ENV=development
    - SESSION_SECRET=12345

As executed by docker-compose:
docker build . -eRACK_ENV=development -eSESSION_SECRET=12345

@aanand
Copy link

aanand commented Aug 3, 2015

docker build doesn't support a -e flag, or any means of passing environment variables in to the build. This functionality would have to be supported by the Docker engine first.

It's been discussed a lot - for example, here's a recent proposal: moby/moby#15182

@aanand aanand closed this as completed Aug 3, 2015
@CyborTronik
Copy link

Does it make sense to reopen this issue? as for docker was implemented?

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

No branches or pull requests

3 participants