# Set environment variables using repo2docker

**URL:** <https://discourse.jupyter.org/t/set-environment-variables-using-repo2docker/34674>\
**Category:** BinderHub\
**Tags:** repo2docker\
**Created:** [April 18, 2025, 9:44am UTC](https://discourse.jupyter.org/t/set-environment-variables-using-repo2docker/34674 "2025-04-18T09:44:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maaaaaaaartin](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/maaaaaaaartin/32/2771_2.png) [@maaaaaaaartin](https://discourse.jupyter.org/u/maaaaaaaartin)\
**Post date:** [April 18, 2025, 9:44am UTC](https://discourse.jupyter.org/t/set-environment-variables-using-repo2docker/34674/1 "2025-04-18T09:44:04Z")

</div>

Hello,  
I am trying to set an environment variables in a `environment.yml` file (cf. [dolfin\_warp-tutorials/.repo2docker/environment.yml at d652be8c959928b79e3c8cc47c283ac663910c49 · mgenet/dolfin\_warp-tutorials · GitHub](https://github.com/mgenet/dolfin_warp-tutorials/blob/d652be8c959928b79e3c8cc47c283ac663910c49/.repo2docker/environment.yml)). The image is built using `repo2docker` in a GitHub Action (cf. [Setting up Docker image and Jupyter book build and deploy on GitHub · mgenet/dolfin\_warp-tutorials@945c219 · GitHub](https://github.com/mgenet/dolfin_warp-tutorials/actions/runs/14532993874/job/40776130552)). Unfortunately the environment variable is not set (cf. [Binder](https://mybinder.org/v2/gh/mgenet/dolfin_warp-tutorials/master?urlpath=tree/./tutos/tuto_warp.ipynb)). Any idea? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [April 18, 2025, 4:53pm UTC](https://discourse.jupyter.org/t/set-environment-variables-using-repo2docker/34674/2 "2025-04-18T16:53:40Z")

</div>

It is the `start` configuration file you want to set environment variables in, see [here](https://discourse.jupyter.org/t/glibcxx-3-4-26-not-found-from-rstudio/7778/6).

From the documentation on `start` [here](https://mybinder.readthedocs.io/en/latest/using/config_files.html#start-run-code-before-the-user-sessions-starts):

> “Use this to set environment variables that software installed in your container expects to be set.”

Example:

> <https://github.com/fomightez/RNArtistCore-binder/blob/8989d573a56ba2af3dfd71dd563affa610764b3b/start>

---

<div class="post-metadata">

**Author:** ![maaaaaaaartin](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/maaaaaaaartin/32/2771_2.png) [@maaaaaaaartin](https://discourse.jupyter.org/u/maaaaaaaartin)\
**Post date:** [April 28, 2025, 7:39am UTC](https://discourse.jupyter.org/t/set-environment-variables-using-repo2docker/34674/3 "2025-04-28T07:39:03Z")

</div>

Thank you! Any idea why the environment variable defined in the `.yml` file is not set? I think it used to be taken into account.
