What is the difference between these scripts for "geth attach"?

I am using using capegemini ethereum docker : https://github.com/Capgemini-AIE/ethereum-docker

  1. geth attach http://localhost:8545
  2. docker exec -it ethereum-docker_eth_1 geth attach ipc://root/.ethereum/devchain/geth.ipc
  3. sudo docker exec -it fa78bf925a6b bash
    geth attach /root/.ethereum/devchain/geth.ipc

All of the above scripts attach to geth and opens javascript console.
But when I check “eth.hashrate” only first script produces some result, rest outputs zero.

All of these should have same behaviour, but its different, why ?

Source: StackOverflow