Hi,
Am trying to set a custom hostname in a container running on a device with balena OS.
Would like to use the device variable as part of the hostname.
In Windows Desktop I can set the option hostname in the docker-compose.yml file, like:
hostname: app-a.${HOSTNAME:-testco.io)
But in balena, this does not work. I tried to use the device variable as well as the custom configuration option for the device with no success.
The device variable HOSTNAME is set within a container as an environment variable,but not substituted by the docker engine.
Attempting to set the hostname at container start seems would not help, because when I try to set it in the terminal within a container, getting a permission denied error.
This is a significant problem in a container running OPC UA Server because it returns the hostname as part of the endpoint, which is later used by the client to connect to it. If the hostname cannot be resolved correctly, some clients cannot connect to the server then.