# Passer un fichier d'environnement à l'image de développement ?

**URL:** https://meta.discourse.org/t/pass-env-file-to-dev-image/88925
**Category:** Development
**Created:** [Juin 1, 2018, 3:22 UTC](https://meta.discourse.org/t/pass-env-file-to-dev-image/88925 "2018-06-01T15:22:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mmayo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mmayo/32/119577_2.png) [@mmayo](https://meta.discourse.org/u/mmayo)
#### Post date: [Juin 1, 2018, 3:22 UTC](https://meta.discourse.org/t/pass-env-file-to-dev-image/88925/1 "2018-06-01T15:22:06Z")

</div>

I don’t see an obvious way to pass environment variables to the dev image, maybe I am missing something? If no such mechanism exists, would Discourse be open to a PR providing the option in the `boot_dev` script?

Something like:

```plaintext
ENV_ARGS=""

while ["${#@}" -ne "0"]; do
    case "$1" in
        # redacted for brevity
        -i | --init)
            initialize="initialize"
            ;;
        -e | --env)
            if [-z "$2"]; then
                show_help
                exit 0
            else  
                ENV_ARGS="--env-file=$2"
                break
            fi
            ;;
        # further redacted for brevity

docker run -d -p 1080:1080 -p 3000:3000 -v "$DATA_DIR:/shared/postgres_data:delegated" -v "$SOURCE_DIR:/src:delegated" $ENV_ARGS --hostname=discourse --name=discourse_dev --restart=always discourse/discourse_dev:release /sbin/boot

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Juin 4, 2018, 5:04 UTC](https://meta.discourse.org/t/pass-env-file-to-dev-image/88925/2 "2018-06-04T05:04:47Z")

</div>

Sure, I have not had to do this in the past so it makes sense it is missing. Feel free to add a PR for improving `boot_dev`, your idea seems pretty spot on, `--env-file` can be a good first move though probably worth supporting `--env` like docker uses as well.

---

<div class="post-metadata">

### Author: ![mmayo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mmayo/32/119577_2.png) [@mmayo](https://meta.discourse.org/u/mmayo)
#### Post date: [Juillet 31, 2018, 9:39 UTC](https://meta.discourse.org/t/pass-env-file-to-dev-image/88925/3 "2018-07-31T21:39:50Z")

</div>

Finally was able to turn back to this:

[https://github.com/discourse/discourse/pull/6212](https://github.com/discourse/discourse/pull/6212)
