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
System.getenv("RABBITMQ_URL")
, 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 :
docker service create --name xxx --env RABBITMQ_URL=amqp://rabbitmq:xxxx --network msgq --with-registry-auth ${imageName}
This is weird but, restarting the docker container just worked fine for me. Turns out , i have to restart the container when ever I update the network connection using "--network". Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With