# BUILDKITE\_JOB\_ID, parallelism and docker-compose, always the same value

**URL:** <https://forum.buildkite.community/t/buildkite-job-id-parallelism-and-docker-compose-always-the-same-value/2126>\
**Category:** Docker\
**Created:** [July 4, 2022, 11:01am UTC](https://forum.buildkite.community/t/buildkite-job-id-parallelism-and-docker-compose-always-the-same-value/2126 "2022-07-04T11:01:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tetienne](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@tetienne](https://forum.buildkite.community/u/tetienne)\
**Post date:** [July 4, 2022, 11:01am UTC](https://forum.buildkite.community/t/buildkite-job-id-parallelism-and-docker-compose-always-the-same-value/2126/1 "2022-07-04T11:01:30Z")

</div>

Hi,

When running a command in parallel, I can well see distinct `BUILDKITE_JOB_ID` value for each parallel job.  
But, when using the docker-compose plugin, the given value for `BUILDKITE_JOB_ID` is always the same, and does not match any existing `BUILDKITE_JOB_ID` values.

So when using the junit annotate plugin, obviously the link to the linked job is wrong. Am I missing something?

Regards,

```auto
- label: ":rspec: Run tests"
    parallelism: 150
    command: |
      bundle exec rake knapsack:rspec["--format progress --format RspecJunitFormatter --out reports/junit/junit-buildkite-job-$BUILDKITE_JOB_ID.xml]
    artifact_paths:
      - reports/**/*
    plugins:
      - docker-compose#v3.9.0:
          config: build/docker-compose.yml
          shell: ["/bin/bash", "-e", "-c"]
          workdir: /usr/src/app
          run: app
          volumes:
            - "./reports:/usr/src/app/reports"
          env:
            - BUILDKITE
            - BUILDKITE_BUILD_NUMBER
            - BUILDKITE_BUILD_URL
            - BUILDKITE_JOB_ID
            - BUILDKITE_BRANCH
            - BUILDKITE_COMMIT
            - BUILDKITE_MESSAGE
            - BUILDKITE_PARALLEL_JOB
            - BUILDKITE_PARALLEL_JOB_COUNT

```

---

<div class="post-metadata">

**Author:** ![paula](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/paula/32/954_2.png) [@paula](https://forum.buildkite.community/u/paula)\
**Post date:** [July 5, 2022, 4:40am UTC](https://forum.buildkite.community/t/buildkite-job-id-parallelism-and-docker-compose-always-the-same-value/2126/2 "2022-07-05T04:40:20Z")

</div>

Hi @tetienne

I think the issue here is on line 4 (in the command attribute). You are using `$BUILDKITE_JOB_ID` which is evaluated on the agent when this step is uploaded to our API, so the job ID you are seeing is that of the job which uploaded this parallel command step.

To get around this, you need to use runtime interpolation: [Environment variables | Buildkite Documentation](https://buildkite.com/docs/pipelines/environment-variables#runtime-variable-interpolation) with `$$BUILDKITE_JOB_ID`. That will evaluate the job ID within the docker container at runtime.

Give that a shot and see how it goes. If that doesn’t solve the problem, it might be best to email [support@buildkite.com](mailto:support@buildkite.com) with a link to your build so we can take a deeper look, unless you are happy to post the link in public here

---

<div class="post-metadata">

**Author:** ![tetienne](https://avatars.discourse-cdn.com/v4/letter/t/ce73a5/32.png) [@tetienne](https://forum.buildkite.community/u/tetienne)\
**Post date:** [July 5, 2022, 9:12am UTC](https://forum.buildkite.community/t/buildkite-job-id-parallelism-and-docker-compose-always-the-same-value/2126/3 "2022-07-05T09:12:36Z")

</div>

Hi @paula,

Thanks you, your suggest was correct. I already tried before posting, but cancelled my pipeline when I saw in the log `$BUILDKITE_JOB_ID`. I’ve retried and wait the end of the jobs, and the variable was well replaced.

---

<div class="post-metadata">

**Author:** ![paula](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/paula/32/954_2.png) [@paula](https://forum.buildkite.community/u/paula)\
**Post date:** [July 5, 2022, 12:43pm UTC](https://forum.buildkite.community/t/buildkite-job-id-parallelism-and-docker-compose-always-the-same-value/2126/4 "2022-07-05T12:43:02Z")

</div>

Excellent! 👍
