I have a Dockerfile that pulls a private repo from github, by using a user Access Token:
ARG DEPLOYMENT_TOKEN
RUN git clone https://$DEPLOYMENT_TOKEN:x-oauth-basic@github.com/company-org/api.git /tmpapp/
Now when I am creating a new app, and environment in elastic beanstalk, how can I provide elastic beanstalk with that access token when it first tries to build the docker image and deploy?
Can this be passed to the eb cli command eb create?
eb create --envvars DEPLOYMENT_TOKEN=$DEPLOYMENT_TOKEN
then when the app tries to create the environment and deploy, it will include the environment variable so that it will be able to pull from the private repo when building the docker image?
I know that eb setenv allows you to set an environment variable post successful deployment, but I want to do this for the docker build process.
I don't want to put the access token inside the Dockerrun file by using the environment key in the container descriptions.
{
"containerDefinitions": [
{
"name": "myContainer",
"image": "something",
"environment": [
{
"name": "MY_DB_PASSWORD",
"value": "password"
}
],
Because that means that information is available to anyone, and anyway I'm not even sure that will work.
I also considered .ebextensions, and am looking into that now.