This is either a request for a new feature or a request for improved documentation.
When running docker containers, a common pattern is to inject configuration information into the container by using environment variables. From the documentation, I'm not sure how to do this.
Hi Daniel, take a look at: https://www.nomadproject.io/docs/jobspec/index.html, you'll be wanting the 'env' setting within the task block. For example, you could add something like this:
env {
DB_HOST = "db01.example.com"
DB_USER = "web"
DB_PASSWORD = "loremipsum"
}
Thanks for the pointer. Looks like I was just looking in the wrong place.
@iverberk. I know this issue is old, but what if you wanted to leverage vault for DB_PASSWORD in your example? TMK, you can't use vault anywhere in the job spec file outside of template.
Asked more directly, is there a way to securely inject passwords or other sensitive items outside of consul template?
Most helpful comment
Hi Daniel, take a look at: https://www.nomadproject.io/docs/jobspec/index.html, you'll be wanting the 'env' setting within the task block. For example, you could add something like this: