This flag, --hostname is used to change the host name of you container, its used when you run your container.
$ docker run --hostname demo nginx
This does not change the container's DNS outside docker and it also does not provide any network isolation, so you cannot connect to the container using the hostname.
Where as the --ip flag is used to assign a specific ip to your container .
$ docker run --ip 10.0.0.2 nginx
Hope this helped :)
Also it's never to late to get certified in docker and devops. if you wish to learn more about docker refer to Docker training course.