Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

FROM jupyter/scipy-notebook

USER root

ARG AWS_ACCESS_KEY_ID
RUN echo {$AWS_ACCESS_KEY_ID}
like image 220
William Falcon Avatar asked Feb 26 '17 01:02

William Falcon


1 Answers

I assume that for every deployment you create a new Dockerrun.aws.json 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.

like image 76
Çağatay Gürtürk Avatar answered Nov 04 '22 00:11

Çağatay Gürtürk