A proper way to pass Deployment ID to environment variable

I need to use a unique ID of each deployment in a startup command in Dockerfile’s CMD.
I was unable to find any documented way to pass any Rancher variable so I’ll be glad if somebody helps.
Using Rancher 2.7.5 (UI, not CLI)