I understand that if my container misbehaves it gets killed.
By misbehaves I mean as @gelbal stated
Yes, high memory / cpu consumption by the application is a plausible reason.
I understand that is necessary, what is not necessary is that the entire container gets deleted.
In production, I won’t have the bandwidth to download an entire container very often. I need the container to stick around so that if I successfully push a patch it uses the cache which works great.
Also, I would appreciate some detail in the logs on why the container was killed so I can get to the bottom of this.
Is there any way I can accomplish those things as the balance supervisor stands, or can someone point me at the relevant code that decides when to kill I container so I can better understand how it functions?
Logs for context and people from the future on google:
Killing service 'main sha256:3b51aaadaf801f4042034c59df5c59b5849681febcec23940a7041897078b5cf' Service exited 'main sha256:3b51aaadaf801f4042034c59df5c59b5849681febcec23940a7041897078b5cf' Killed service 'main sha256:3b51aaadaf801f4042034c59df5c59b5849681febcec23940a7041897078b5cf' Deleting image 'registry2.balena-cloud.com/v2/09502b550b4c5258b15a231b29374b4c@sha256:d8dd231fa99b92ca09bee30e9071134ad77dfb41f07da5194f841c64c752bc39' Deleted image 'registry2.balena-cloud.com/v2/09502b550b4c5258b15a231b29374b4c@sha256:d8dd231fa99b92ca09bee30e9071134ad77dfb41f07da5194f841c64c752bc39' Removing volume 'resin-data'
Support access is enabled, please do not restart the device.
The problem is with window CLI version 9.15.5 as of version 10.1.1 the problem is gone.
In short, when ctrl+c was pressed after the build succeeded it mistakenly cancelled the build and removed it from the device.