# Rancer cli and environment variables problem

**URL:** <https://forums.suse.com/t/rancer-cli-and-environment-variables-problem/9786>\
**Category:** General\
**Created:** [March 15, 2018, 2:29pm UTC](https://forums.suse.com/t/rancer-cli-and-environment-variables-problem/9786 "2018-03-15T14:29:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkaramol](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/pkaramol/32/2883_2.png) [@pkaramol](https://forums.suse.com/u/pkaramol)\
**Post date:** [March 15, 2018, 2:29pm UTC](https://forums.suse.com/t/rancer-cli-and-environment-variables-problem/9786/1 "2018-03-15T14:29:43Z")

</div>

I am trying to create a stack via `rancher` cli.

My `docker-compose.yml` has several env vars defined in some services, as e.g.:

```
 myservice:
    image: someimage
    environment:
       - ENV_VAR1
       - ENV_VAR2

```

The problem is that if these env vars are exported to the shell running the following command:

`rancher stack create --start -f docker-compose.yml -r rancher-compose.yml my-stack-name`

they are not consumed, i.e. the `docker-compose.yml` generated once the service has been started has none of the above vars.

This was not the case with `rancher-compose` utility.

Any help how to handle this with `rancher` cli?
