Get elastic beanstalk environment variables in docker container


So, i’m trying not to put sensitive information on the dockerfile. A logical approach is to put the creds in the ebs configuration (the GUI) as a ENV variable. However, docker build doesn’t seem to be able to access the ENV variable. Any thoughts?

enter image description here


I assume that for every deployment you create a new file with the correct docker image tag for that deployment. At deployment stage, you can inject environment values which will then be used in docker run command by EB agent. So your docker containers can now access to these environment variables.

Leave a Reply