chef-provisioning-docker icon indicating copy to clipboard operation
chef-provisioning-docker copied to clipboard

Environment Vars

Open matiasdecarli opened this issue 10 years ago • 1 comments

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

matiasdecarli avatar Oct 06 '14 19:10 matiasdecarli

This is a good idea.

jkeiser avatar Feb 26 '15 07:02 jkeiser