# How can I pass a variable to the container I'm building?

**URL:** <https://community.okteto.com/t/how-can-i-pass-a-variable-to-the-container-im-building/46>\
**Category:** How Do I?\
**Created:** [April 28, 2022, 7:02pm UTC](https://community.okteto.com/t/how-can-i-pass-a-variable-to-the-container-im-building/46 "2022-04-28T19:02:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramiro](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/ramiro/32/6_2.png) [@ramiro](https://community.okteto.com/u/ramiro)\
**Post date:** [April 28, 2022, 7:02pm UTC](https://community.okteto.com/t/how-can-i-pass-a-variable-to-the-container-im-building/46/1 "2022-04-28T19:02:33Z")

</div>

I want to be able to pass a variable defined in the “variables” section of the Launch Development Environment to my application, so that the value can be used when I’m building my container.

---

<div class="post-metadata">

**Author:** ![pchico83](https://sea1.discourse-cdn.com/flex019/user_avatar/community.okteto.com/pchico83/32/25_2.png) [@pchico83](https://community.okteto.com/u/pchico83)\
**Post date:** [April 28, 2022, 7:54pm UTC](https://community.okteto.com/t/how-can-i-pass-a-variable-to-the-container-im-building/46/2 "2022-04-28T19:54:52Z")

</div>

In order to pass a variable (or a secret) to your Dockerfile, you need to do it using the [ARG Dockerfile instruction](https://docs.docker.com/engine/reference/builder/#arg).

Then, pass your okteto variable/secret as an `arg` in the build section of your [okteto manifest](https://www.okteto.com/docs/reference/manifest/#build-object-optional) or your [docker compose file](https://www.okteto.com/docs/reference/compose/#build-stringobject-optional).

It would look something like this:

```auto
build:
   context: .
   args:
      - MY_ARG=${MY_OKTETO_SECRET}

```
