Dockerode: docker run -e ENV="TEST"

Created on 18 Nov 2014  路  2Comments  路  Source: apocas/dockerode

Hello,

Do we have the possibility to pass an environment variable to the docker.run() function ?

Thanks

question

Most helpful comment

For those looking for an example...

docker.run('test:latest', ['node', '/root/test.js'], [process.stdout, process.stderr], {Tty: false, env: ['NODE_ENV=development']}, function(error, data, container) {
    ...
});

Source: http://stackoverflow.com/a/24792554/83897

All 2 comments

Sure just pass the env option in run's "create_options".
Check https://github.com/apocas/dockerode#equivalent-of-docker-run-in-dockerode

For those looking for an example...

docker.run('test:latest', ['node', '/root/test.js'], [process.stdout, process.stderr], {Tty: false, env: ['NODE_ENV=development']}, function(error, data, container) {
    ...
});

Source: http://stackoverflow.com/a/24792554/83897

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lakindu95 picture lakindu95  路  3Comments

mhemrg picture mhemrg  路  4Comments

gaetsd picture gaetsd  路  3Comments

IniZio picture IniZio  路  3Comments

nuest picture nuest  路  3Comments