Ros noetic image cannot find files in volume
I have a docker image of ros noetic : noetic-ros-core I have created a volume named catkin_ws connected to my personal noetic_ws:
sudo docker run --net=host --env="DISPLAY" -v ~/noetic_ws:/root/catkin_ws --name roslocal -it ros:noetic-ros-core roscore
In a second terminal I run a node connected to this with:
sudo docker exec -it roslocal bin/bash
But when I run my script
synt_win = loadmat('root/catkin_ws/synt_win.mat')['synt_win']
I get
FileNotFoundError: [Errno 2] No such file or directory: 'root/catkin_ws/synt_win.mat'
I also tried directing the script to my personal noetic_ws but this has not worked (and would not be logical to me if worked)
In my docker container the file exists.
I think this has more to do with how ROS works than how docker works but please correct me if I'm wrong.