Both Docker config and setting environment variables for containers seems to accomplish the same goals. Especially when considering the environment variables to set can get fetched from a file (env_file).
What are the benefits of docker config over setting environment variables for containers?
There are many, but it's mainly a matter of choice. Here are some benefits:
docker config commands where environment variables are notMONGODB_HOST=mongodb://foo:bar@my-mongo:27017 pointing to Mongo database but a library you are using in your application will also use this variable but expect a simple hostname such as my-mongo and throw an exception at runtimecat myconfig VS. env)You may take a look at this post which is not Docker specific but may give some insights.
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