How to set a container hostname based on RancherOS hostname

I’d like to know if any of you was able to set a container hostname based on the RancherOS hostname?
My ros image is a vmware image, so, part of my OVF, I’m setting guestinfo.hostname, which works fine. But I’d also like one of my container to use the same hostname.
I found that I can use in my compose service a “environment” with a null value, to retrieve it from rancher.environment, but how to transfer it there?
If I change my ovf config to use rancher.environment, this will not be set automatically to any rancher. properties.

Anybody found a cool way of doing this?