]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/start.c
Support providing env vars to container init
authorMatt Palmer <mpalmer@hezmatt.org>
Tue, 1 Jul 2014 07:01:39 +0000 (17:01 +1000)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 31 Jul 2014 17:54:20 +0000 (13:54 -0400)
commit7c6617262d4cd1f8f2c1721aca980ecd71117bd5
tree3be6e01aead6d3d088deec7f9beccd1c99b1bb0f
parentacabe1faee82d44db391345a8a51b9dec3dc0229
Support providing env vars to container init

It's quite useful to be able to configure containers by specifying
environment variables, which init (or initscripts) can use to adjust the
container's operation.

This patch adds one new configuration parameter, `lxc.environment`, which
can be specified zero or more times to define env vars to set in the
container, like this:

    lxc.environment = APP_ENV=production
    lxc.environment = SYSLOG_SERVER=192.0.2.42
    lxc.environment = SOMETHING_FUNNY=platypus

Default operation is unchanged; if the user doesn't specify any
lxc.environment parameters, the container environment will be what it is
today ('container=lxc').

Signed-off-by: Matt Palmer <mpalmer@hezmatt.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
doc/lxc.container.conf.sgml.in
src/lxc/conf.c
src/lxc/conf.h
src/lxc/confile.c
src/lxc/start.c