How to bind mount user related files

Hi all,

I am newer to Docker, can any one help me to solve my problem? Thanks! Recently, I wrote a shell using C++. The shell has the ability to save typing history in ~/.taos_history. So, when the shell launch again, the shell can read from the history file. When I using docker to run this shell, I find a problem: If I use bind mount, I will always need to create the .taos_history before running the shell, and specify the full path of the file like this:

docker run -it --mount type=bind,source=/home/kalson/.taos_history, target=/root/.taos_history taos_img

If I run the shell using another account, I need to create another .taos_history file and will run it:

docker run -it --mount type=bind,source=/home/other_account/.taos_history, target=/root/.taos_history taos_img

Is there an easy way to specify the user related history file? For example:

docker run -it --mount type=bind,source=~/.taos_history, target=/root/.taos_history taos_img

I know, command above is not correct. Is there a better way to solve this problem? Thank you all!