admin管理员组

文章数量:1122846

I have a docker compose image for Apache/Spark and am trying to send Enviroment Varibles for AWS connection they are being saved in a common config block as per below.

  x-spark-common: &spark-common
     image: bitnami/spark:3.5.4
     environment:
       - AWS_REGION=us-east-1
       - AWS_ACCESS_KEY_ID=admin 
       - AWS_SECRET_ACCESS_KEY=password 
      volumes:

When I start the container and connect to it using Bash and run 'env' I do see the varibles being assigned correctly

AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=admin
AWS_SECRET_ACCESS_KEY=password

however when I attempt to read the enviroment using os.environ it returns None for everything.

I have tried os.getenv os.environ but both return None

本文标签: pythonDocker Compose Enviroment varibles cannot be read by applicationStack Overflow