# When I run fly deploy with the "--image-label" flag, why does it deploy an older version of my code?

**URL:** <https://community.fly.io/t/when-i-run-fly-deploy-with-the-image-label-flag-why-does-it-deploy-an-older-version-of-my-code/26151>\
**Category:** General\
**Tags:** registry, login-only\
**Created:** [October 10, 2025, 1:02pm UTC](https://community.fly.io/t/when-i-run-fly-deploy-with-the-image-label-flag-why-does-it-deploy-an-older-version-of-my-code/26151 "2025-10-10T13:02:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkpo](https://avatars.discourse-cdn.com/v4/letter/g/a8b319/32.png) [@gkpo](https://community.fly.io/u/gkpo)\
**Post date:** [October 10, 2025, 1:02pm UTC](https://community.fly.io/t/when-i-run-fly-deploy-with-the-image-label-flag-why-does-it-deploy-an-older-version-of-my-code/26151/1 "2025-10-10T13:02:08Z")

</div>

Having an issue where two similar deploy commands are giving different results.

Command 1:  
flyctl deploy --remote-only --config fly-dev.toml --image-label latest

Command 2:  
flyctl deploy --remote-only --config fly-dev.toml

Results:

- Command 1: uses --image-label latest, seems to pull cached/older image and doesn’t reflect my latest changes in code
- Command 2: fresh build with unique deployment ID, my deployment shows the latest code changes

Both run from same directory/commit/branch. Command 1 was working correctly for months, then suddenly started deploying stale code. I suspect that the --image-label latest is now causing it to reuse an older tagged image instead of building fresh.

FYI, the --image-label is supposed to allow me to name my image “latest“. I’m doing this because I use fly cron-manager from another app, and I have to reference the latest build image directly, without having to specify its id each time. So i’m labelling it.

Anyone else run into this recently? Did something change with how Fly handles image labels in remote builds?

---

<div class="post-metadata">

**Author:** ![wjordan](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/wjordan/32/1280_2.png) [@wjordan](https://community.fly.io/u/wjordan)\
**Post date:** [October 10, 2025, 4:55pm UTC](https://community.fly.io/t/when-i-run-fly-deploy-with-the-image-label-flag-why-does-it-deploy-an-older-version-of-my-code/26151/2 "2025-10-10T16:55:49Z")

</div>

Hi @gkpo,

Yes, we did make some registry-related changes this past week, see [Faster, more reliable image deploys for all remote builders](https://community.fly.io/t/faster-more-reliable-image-deploys-for-all-remote-builders/26072) for some general details. It’s possible that mutable tags (like `latest`) that are overwritten aren’t matching their original expected behavior.

Thanks for reporting this issue, we’ll look into this and if it is a registry issue, hopefully restore the original mutable-tag behavior soon. In the meantime, you can try a deploy with the `--depot=false` flag (legacy builders don’t currently use the same registry optimizations) to see if that still works as expected for you.

---

<div class="post-metadata">

**Author:** ![khuezy](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@khuezy](https://community.fly.io/u/khuezy)\
**Post date:** [October 10, 2025, 5:03pm UTC](https://community.fly.io/t/when-i-run-fly-deploy-with-the-image-label-flag-why-does-it-deploy-an-older-version-of-my-code/26151/3 "2025-10-10T17:03:42Z")

</div>

I think I encountered this issue, or maybe it’s slightly different. Can you revert or fix the change that prevented large images (but within limit) from successfully deploying.

Context: [Fly deploy fails when pushing local only - #10 by Sam-Fly](https://community.fly.io/t/fly-deploy-fails-when-pushing-local-only/26131/10)

---

<div class="post-metadata">

**Author:** ![wjordan](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/wjordan/32/1280_2.png) [@wjordan](https://community.fly.io/u/wjordan)\
**Post date:** [October 14, 2025, 7:52pm UTC](https://community.fly.io/t/when-i-run-fly-deploy-with-the-image-label-flag-why-does-it-deploy-an-older-version-of-my-code/26151/4 "2025-10-14T19:52:33Z")

</div>

Hi @gkpo, we’ve rolled out a potential fix for this issue, give it another try and let us know if it’s working for you again. Thanks again for the report and sorry for the inconvenience to your workflow!

---

<div class="post-metadata">

**Author:** ![gkpo](https://avatars.discourse-cdn.com/v4/letter/g/a8b319/32.png) [@gkpo](https://community.fly.io/u/gkpo)\
**Post date:** [October 16, 2025, 3:20pm UTC](https://community.fly.io/t/when-i-run-fly-deploy-with-the-image-label-flag-why-does-it-deploy-an-older-version-of-my-code/26151/5 "2025-10-16T15:20:34Z")

</div>

it worked indeed 🙂 thanks so much @wjordan

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [October 23, 2025, 3:21pm UTC](https://community.fly.io/t/when-i-run-fly-deploy-with-the-image-label-flag-why-does-it-deploy-an-older-version-of-my-code/26151/6 "2025-10-23T15:21:27Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
