Container Bind Mount directory freeze after a few days of no activity

I’m trying to figure out why my bind mount point within my container freezes; I’m assuming the connection is lost after several days of no activity. I have to restart the container in order to get it working again. I really prefer to not constantly restart the container every few days to reconnect the bind mount point. I know for sure the host machine did not lose the autofs connection to the server. I do know my network team does reboot the network server once a month. But I would assume because the host machine is using autofs that the container should still be able to dynamically re-establish a connection.

Here’s my command on how on created my container:
docker run -d -it --name test_container --mount type=bind,source=/mnt/autofs_dir/,target=/shared/ test_image

I can go inside this container and run ‘ls -l /shared’ and I do see files inside this directory.

The /mnt/autofs_dir/ is the host machine directory this is mounted to another server via autofs.

The /shared/ is the folder inside the test_container container.

After several days with no activity on the docker test_container, the when i try to run ls /shared/ in the test_container, it freezes and does nothing.

Here’s an excerpt of running docker inspect test_container:

“Mounts”: [
“Type”: “bind”,
“Source”: “/mnt/autofs_dir/”,
“Destination”: “/shared”,
“Mode”: “”,
“RW”: true,
“Propagation”: “rprivate”