chef-provisioning-docker
chef-provisioning-docker copied to clipboard
Environment Vars
Im having this issue, where the ENV vars declared before running the resource, are not taking into account when the command is excecuted.
Here is the recipe
ENV['URL']="https://www.testurl.com"
machine actual do
machine_options :docker_options => {
:base_image => {
:name => 'matiasdecarli/release',
:repository => 'matiasdecarli',
:tag => 'latest'
},
:command => '/usr/bin/node /matiasdecarli/app.js',
:ports => port.to_s + ':8080',
:keep_stdin_open => true
}
end
The error that I get is the app crashing when trying to start because URL being undefined. I can see a posible solution (https://docs.docker.com/reference/run/#env-environment-variables), having the option to pass an array with env vars
This is a good idea.