Accessing Elastic Beanstalk environment properties in Docker

后端 未结 3 1957
难免孤独
难免孤独 2020-12-31 06:37

So I\'ve been looking around for an example of how I can specify environment variables for my Docker container from the AWS EB web interface. Typically in EB you can add env

3条回答
  •  青春惊慌失措
    2020-12-31 06:53

    I've needed to pass environment variable in moment docker run using Elastic Beanstalk, but, is not allowed put this information in Dockerrun.aws.json.

    Below the steps to resolve this scenario:

    1. Create a folder .ebextensions
    2. Create a .config file in the folder
    3. Fill the .config file:

    option_settings:
    -option_name: VARIABLE_NAME value: VARIABLE_VALUE

    1. Zip the folder .ebextensions file along with the Dockerrun.aws.json plus Dockerfile and upload it to Beanstalk

    To see the result, inside EC2 instance, execute the command "docker inspect CONTAINER_ID" and will see the environment variable.

提交回复
热议问题