Docker - Containers - Assign a hostname to the container

docker run --hostname=value

or

docker run -h value

NOTE: --name and --hostname are both useful for identification of containers.

The value supplied to the –hostname command is set inside /etc/hostname and /etc/hosts inside the container.

Consequently, it appears in the command prompt of the container.

It plays a role in configuring container DNS.

It is not easy to access from outside the container, but it will appear in the container's log files, and when those files are written to a volume independent of the host, it can make it easier to identify the container.