This is kind of a duplicate question to this one. . But ironically, in spite of that question's title, all the answers say: Use an ENV variable.
My use case: I don't know if docker is running via docker-compose or swarm. However, it will not be docker run! I am trying to kick off an upgrade script that resides on the host. Thus, from within a container I need the docker host name. Is there any programmatic way to get this WITHOUT environment variables?