# How do i set custom environment variables when running build in docker?

**URL:** <https://discuss.bitrise.io/t/how-do-i-set-custom-environment-variables-when-running-build-in-docker/1113>\
**Category:** Question & Answer\
**Created:** [March 13, 2017, 3:05pm UTC](https://discuss.bitrise.io/t/how-do-i-set-custom-environment-variables-when-running-build-in-docker/1113 "2017-03-13T15:05:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![keven-pogrzeba](https://avatars.discourse-cdn.com/v4/letter/k/f17d59/32.png) [@keven-pogrzeba](https://discuss.bitrise.io/u/keven-pogrzeba)\
**Post date:** [March 13, 2017, 3:05pm UTC](https://discuss.bitrise.io/t/how-do-i-set-custom-environment-variables-when-running-build-in-docker/1113/1 "2017-03-13T15:05:19Z")

</div>

custom environment variables are able to to be set in the schedule a build dialog, but how do i do this with docker?

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 13, 2017, 3:27pm UTC](https://discuss.bitrise.io/t/how-do-i-set-custom-environment-variables-when-running-build-in-docker/1113/2 "2017-03-13T15:27:09Z")

</div>

Hi @keven-pogrzeba,

Thanks for asking this here! 😉

> [@keven-pogrzeba](#):
>
> custom environment variables are able to to be set in the schedule a build dialog

You can use **App Env Vars** and **Secret Env Vars** in the Workflow Editor to set permanent environment variables. There are also Workflow Env Vars, which are only accessible for that workflow ([http://devcenter.bitrise.io/bitrise-cli/workflows/#define-workflow-specific-parameters-environment-variables](http://devcenter.bitrise.io/bitrise-cli/workflows/#define-workflow-specific-parameters-environment-variables)).

> [@keven-pogrzeba](#):
>
> but how do i do this with docker?

Most likely this is not what you meant, but if you run `docker` commands in e.g. a **Script** step you pass env vars the same way you would locally, with the `-e` flag passed to `docker run` (e.g. `docker run -e "KEY=value" ...` - docs: [Docker run reference | Docker Docs](https://docs.docker.com/engine/reference/run/#env-environment-variables)).

_Unless you run `docker` commands directly, you can simply use the App/Secret/Workflow Env Vars as noted above._

If you have any questions just let us know!  
Happy Building! 🙂
