# Rancher cli - rancher run command with environment parameter

**URL:** <https://forums.suse.com/t/rancher-cli-rancher-run-command-with-environment-parameter/6207>\
**Category:** General\
**Created:** [April 21, 2017, 3:43am UTC](https://forums.suse.com/t/rancher-cli-rancher-run-command-with-environment-parameter/6207 "2017-04-21T03:43:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![neil\_lau24](https://avatars.discourse-cdn.com/v4/letter/n/e19b73/32.png) [@neil\_lau24](https://forums.suse.com/u/neil_lau24)\
**Post date:** [April 21, 2017, 3:43am UTC](https://forums.suse.com/t/rancher-cli-rancher-run-command-with-environment-parameter/6207/1 "2017-04-21T03:43:23Z")

</div>

when run command: rancher run  
I find there is no **environment** parameter (as docker run **-e** )  
I can not add a service to a stack without -e parameter

whether add **environment** parameter (as docker run **-e** ) to rancher run at next rancher cli version?

---

<div class="post-metadata">

**Author:** ![tfiduccia](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/tfiduccia/32/2005_2.png) [@tfiduccia](https://forums.suse.com/u/tfiduccia)\
**Post date:** [April 24, 2017, 11:53pm UTC](https://forums.suse.com/t/rancher-cli-rancher-run-command-with-environment-parameter/6207/2 "2017-04-24T23:53:15Z")

</div>

@neil_lau24

I’m unsure of your exact problem. In the CLI, if you have more than 1 environment and wish to change you enter the ./rancher config command and it will list all your environments and you can select one.

If you are just trying to add a service to stack that already exist and you are in the correct environment you need to pass in --name and give the stackName/serviceName in the run command.

---

<div class="post-metadata">

**Author:** ![tfiduccia](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/tfiduccia/32/2005_2.png) [@tfiduccia](https://forums.suse.com/u/tfiduccia)\
**Post date:** [April 25, 2017, 5:31pm UTC](https://forums.suse.com/t/rancher-cli-rancher-run-command-with-environment-parameter/6207/3 "2017-04-25T17:31:40Z")

</div>

@neil_lau24 - Yesterday I misunderstood your issue. I though you were asking about environment management and now I think you are asking to add a environment variables to service. I added a issue in github to address this. Here is the issue if you want to track it or comment on it.

[https://github.com/rancher/rancher/issues/8589](https://github.com/rancher/rancher/issues/8589)

---

<div class="post-metadata">

**Author:** ![neil\_lau24](https://avatars.discourse-cdn.com/v4/letter/n/e19b73/32.png) [@neil\_lau24](https://forums.suse.com/u/neil_lau24)\
**Post date:** [April 27, 2017, 12:50am UTC](https://forums.suse.com/t/rancher-cli-rancher-run-command-with-environment-parameter/6207/5 "2017-04-27T00:50:46Z")

</div>

This is what I think，thank u very much！
