Probably it is the hostname assigned to the docker machine (which surely it is not localhost). Try to change alfresco.host variable in your docker setup, you may probably use there the IP address assigned to the docker machine.
The localhost:8082 url is a different thing, it is the url mapped of your Alfresco repo to your machine in 8082 port. If you need to change this port, you should change docker-compose yaml configuration file. Just look for 8082, and change it by a free port on your local machine.
Considering alfresco.host variable, what is the actual file I need to make changes in? I found one in the config-repository.yaml file. And how to find out the IP address assigned to the docker machine?
By the way, the hostname in my hyperlink seems to be equal to docker container ID (I got one using "docker container ls" command).
1. The alfresco.host variable is part of the alfresco-global.properties file in the docker machine. You may extend your docker deployment, to change this parameter to your current IP of your docker machine, for example, usually 172.17.0.2. You can build and own docker file, or mount a docker volume for alfresco-global.properties file, even to include this var as -Dalfresco.host in JAVA_OPTS.