Build image locally-disabling local mode the local image does not exist anymore

Hello,

I push an image from dockerfile in local mode. When the build is finished i print the image list and i have two more images (local_image_app and alpine) and one more container running the local_image_app image . Eveyrhing running ok.
Then i disable local mode for some time and after i enable local mode again.
Then i see that the image local_image_app is not exist anymore but the alpine is in the image list.
Why that happens?

Thanks

Hiya, when a device leaves local mode, local mode images are removed; from https://www.balena.io/docs/learn/develop/local-mode/#caveats

When switching out of localMode and back to tracking releases from balenaCloud, the balena supervisor will destroy any localMode containers and volumes as well as clean up unneeded base images, and then start up the application that balenaCloud instructs it to run.

Yes i realize that. But why remove only the local_image_app and does not remove the alpine image or other images that i had already loaded (but never run them) when i was in local mode. Is it because remove only the images that was running as a container?
Sorry if my question looks stupid but i m beginner in docker technology and balena general.

Thank you very much

hi @xamsak , what OS version are you running. I believe in 2.39 the supervisor v9.18.0 has better clean up logic and will remove even the alpine images,but its not yet released. It should start rolling out in the next week or so.

hi,
ok i see. So the normal operation is to remove all images except these that the balenaCloud instructs to run.
I m running 2.38.0+rev1.

Thank you very much!

Yeah, I believe in 2.39 the behaviour will be to remove all images that are not associated with the services instructed to run by the balenaCLoud api