# How to use Build Number inside Pipeline step as Image:tag or version?

**URL:** <https://forum.buildkite.community/t/how-to-use-build-number-inside-pipeline-step-as-image-tag-or-version/865>\
**Category:** General\
**Created:** [January 16, 2020, 7:35am UTC](https://forum.buildkite.community/t/how-to-use-build-number-inside-pipeline-step-as-image-tag-or-version/865 "2020-01-16T07:35:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngurjar](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@ngurjar](https://forum.buildkite.community/u/ngurjar)\
**Post date:** [January 16, 2020, 7:35am UTC](https://forum.buildkite.community/t/how-to-use-build-number-inside-pipeline-step-as-image-tag-or-version/865/1 "2020-01-16T07:35:01Z")

</div>

I want to use Buildkite Build Number inside Pipeline step.  
I tried using **$BUILDKITE\_BUILD\_NUMBER** inside pipeline step command.  
However it gives error on save, saying BUILDKITE\_BUILD\_NUMBER is not available.  
How can I use Build Number inside the pipeline?

Normally in Jenkins, we use Build or Job number inside pipeline while building Image for build tag.

Regards

---

<div class="post-metadata">

**Author:** ![anon17095254](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@anon17095254](https://forum.buildkite.community/u/anon17095254)\
**Post date:** [May 1, 2020, 1:33am UTC](https://forum.buildkite.community/t/how-to-use-build-number-inside-pipeline-step-as-image-tag-or-version/865/2 "2020-05-01T01:33:25Z")

</div>

Hi Neelesh,

Sorry that the docs aren’t clear about this. The YAML editor you are using is still a beta feature and we are still working on the docs for it. Only a subset of environment variable are currently available to the editor, which is why you see the error. This article has a list of the environment variables that are available:  
[https://forum.buildkite.community/t/defining-pipeline-build-steps-with-yaml/79](https://forum.buildkite.community/t/defining-pipeline-build-steps-with-yaml/79)

You can, however, access the environment variable in a script, e.g. add a `command` step with a shell script that queries the environment variable. If you want to use the value in a subsequent step, you can pass it to a meta-data key.
