app: env variables are part of container config

I don't completely grok the difference between container config
and host config.
This commit is contained in:
Girish Ramakrishnan
2014-06-05 13:02:04 -07:00
parent 27cb1bd139
commit 0f11373118
+10 -9
View File
@@ -211,13 +211,22 @@ function startApp(app, callback) {
callback();
};
var env = [ ];
var portBindings = { };
portBindings[manifest.http_port + '/tcp'] = [ { HostPort: app.httpPort + '' } ];
if (typeof manifest.tcp_ports === 'object' && app.internalPort in manifest.tcp_ports) {
portBindings[app.internalPort + '/tcp'] = [ { HostPort: app.externalPort + '' } ];
env.push(manifest.tcp_ports[app.internalPort].environment_variable + '=' + app.externalPort);
}
var containerOptions = {
Hostname: app.location + '.' + HOSTNAME,
Tty: true,
Image: manifest.docker_image,
Cmd: null,
Volumes: { },
VolumesFrom: ''
VolumesFrom: '',
Env: env
};
debug('Running ' + manifest.docker_image);
@@ -234,14 +243,6 @@ function startApp(app, callback) {
// TODO: should wait for update to complete
appdb.update(app.id, { containerId: container.id }, NOOP_CALLBACK);
var env = [ ];
var portBindings = { };
portBindings[manifest.http_port + '/tcp'] = [ { HostPort: app.httpPort + '' } ];
if (typeof manifest.tcp_ports === 'object' && app.internalPort in manifest.tcp_ports) {
portBindings[app.internalPort + '/tcp'] = [ { HostPort: app.externalPort + '' } ];
env.push(manifest.tcp_ports[app.internalPort].environment_variable + '=' + app.externalPort);
}
var startOptions = {
// Binds: [ '/tmp:/tmp:rw' ],
PortBindings: portBindings,