Docker worker hostname from container

Hi

I am very new to docker. Is there anyway to get the docker worker node name from inside a container.
We use docker service create and hence passing it as env variable of $HOSTNAME only sends the hostname of docker manager.

Please help

Hi All,

the docker version if needed is Docker version 17.06.2-ee-25.

i know in ce version we can use {{.Node.Hostname}}. But its not avaialble in ee.

According docs (see bottom of the page) the template variable you try to use was not implemented in 17.06. You can not expect an older EE version to have features a more recent CE version has.

With a valid subscription, you can update to a more recent version of the engine.
if you run a Docker-EE engine without a valid subscription It is a license violation… Even if you downloaded the binaries in a timeframe your subscription was valid.