title: How to read docker env variables into Java code
body: <p>I am trying to dockerize my Java application which tries to connect to a Rabbitmq server. I have passed the Rabbitmq Url via docker env variable and readig the same url using</p>
  
  <blockquote>
    <p>System.getenv("RABBITMQ_URL")</p>
  </blockquote>
  
  <p>, but it came out to be null. Is there anything wrong with the way I am reading the docker env variable ?  Here is my Docker create command :</p>
  
  <blockquote>
    <p>docker service create --name xxx --env
    RABBITMQ_URL=amqp://rabbitmq:xxxx --network msgq --with-registry-auth
    ${imageName}</p>
  </blockquote>