EnvironmentΒΆ

There are a few ways to pass environment variables from the runner’s environment into a container.

Firstly, any environment variable that starts with VAGGAENV_ will have it’s prefix stripped, and exposed in the container’s environment:

$ VAGGAENV_FOO=BAR vagga _run container printenv FOO
BAR

The -e or --use-env command line option can be used to mark environment variables from the runner’s environment that should be passed to container:

$ FOO=BAR vagga --use-env=FOO _run container printenv FOO
BAR

And finally the -E, --env or --environ command line option can be used to assign an environment variable that will be passed to the container:

$ vagga --environ FOO=BAR _run container printenv FOO
BAR

The order of precedence for environment variables from the highest priority to the lowest:

  1. Options -E/--environ in the command-line
  2. Options -e/--use-env in the command-line
  3. VAGGAENV_* variables
  4. Variables set inside one of the settings files: environ option
  5. Variables set in command: environ option
  6. Variables set in container: environ option
  7. Variables set in container: environ-file option
  8. Variables that are auto-propagated: *_proxy, TERM