# Are app environment vars available at build time?

**URL:** <https://community.convox.com/t/are-app-environment-vars-available-at-build-time/755>\
**Category:** Configuration\
**Created:** [June 18, 2020, 1:13am UTC](https://community.convox.com/t/are-app-environment-vars-available-at-build-time/755 "2020-06-18T01:13:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![syngency](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.convox.com/syngency/32/150_2.png) [@syngency](https://community.convox.com/u/syngency)\
**Post date:** [June 18, 2020, 1:13am UTC](https://community.convox.com/t/are-app-environment-vars-available-at-build-time/755/1 "2020-06-18T01:13:45Z")

</div>

We need to pass our AWS credentials to a grunt task in our Dockerfile, but it doesn’t seem that `convox build` (or a build created by an automated workflow) can access any of the environment variables set in the `convox.yml` or the app’s Environment tab.

Is there a best-practice method for achieving this?

---

<div class="post-metadata">

**Author:** ![nickf](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.convox.com/nickf/32/137_2.png) [@nickf](https://community.convox.com/u/nickf)\
**Post date:** [June 18, 2020, 5:12am UTC](https://community.convox.com/t/are-app-environment-vars-available-at-build-time/755/2 "2020-06-18T05:12:12Z")

</div>

You should be able to accomplish this with Convox [Build Variables](https://docs.convox.com/configuration/dockerfile#build-variables).

For example, here’s how you can parametrize the version of Bundler for your Ruby app. In your Dockerfile:

```auto
FROM ubuntu:16.04
...
ARG BUNDLER_VERSION=2.0.0
RUN gem install bundler -v ${BUNDLER_VERSION} && rbenv rehash
...

```

This sets a default value for `BUNDLER_VERSION` which you can then override by setting an environment variable using the Convox CLI, Environment Tab, or `convox.yml`:

```auto
$ convox env set BUNDLER_VERSION=2.00

```

You can also use declare a build variable without a default value.

---

<div class="post-metadata">

**Author:** ![syngency](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.convox.com/syngency/32/150_2.png) [@syngency](https://community.convox.com/u/syngency)\
**Post date:** [June 18, 2020, 5:33am UTC](https://community.convox.com/t/are-app-environment-vars-available-at-build-time/755/3 "2020-06-18T05:33:19Z")

</div>

Thanks for the prompt reply, Nick.

Does `convox env set` only need to be run once, and it will then apply for future builds both local and in production?
