examples/exec_running_container.js
function runExec(container) {

  var options = {
    Cmd: ['bash', '-c', 'echo test $VAR'],
    Env: ['VAR=ttslkfjsdalkfj'],
    AttachStdout: true,
    AttachStderr: true
  };

  container.exec(options, function(err, exec) {
    if (err) return;
    exec.start(function(err, stream) {
      if (err) return;

      container.modem.demuxStream(stream, process.stdout, process.stderr);

      exec.inspect(function(err, data) {
        if (err) return;
        console.log(data);
      });
    });
  });
}
function runExec(container) {

  var options = {
    Cmd: ['bash', '-c', 'echo test $VAR'],
    Env: ['VAR=ttslkfjsdalkfj'],
    AttachStdout: true,
    AttachStderr: true
  };

  container.exec(options, function(err, exec) {
    if (err) return;
    exec.start(function(err, stream) {
      if (err) return;

      container.modem.demuxStream(stream, process.stdout, process.stderr);

      exec.inspect(function(err, data) {
        if (err) return;
        console.log(data);
      });
    });
  });
}
function runExec ( container ) { var options = { Cmd : [ 'bash' , '-c' , 'echo test $VAR' ] , Env : [ 'VAR=ttslkfjsdalkfj' ] , AttachStdout : true , AttachStderr : true } ; container . exec ( options , function ( err , exec ) { if ( err ) return ; exec . start ( function ( err , stream ) { if ( err ) return ; container . modem . demuxStream ( stream , process . stdout , process . stderr ) ; exec . inspect ( function ( err , data ) { if ( err ) return ; console . log ( data ) ; } ) ; } ) ; } ) ; }
Get env list from running container
@param container
Get env list from running container