Not this?.. /root/syncthing/st-sync:/var/syncthing
(In your example, you’ve got a relative path for overlay target.)
Unfortunately, that won’t do what you’d like it to do…
As you already know, the linkTest portion of /root/syncthing/st-sync/linkTest is a symlink.
Inside a Docker/OCI container, /var/syncthing/linkTest will still be a symlink. But inside the container the root directory (/) isn’t the same location as the root directory outside of the container.
So since the symlink points to /home/ubuntu/linkTest, it’s what will be expected whenever the symlink is followed inside the container. Or in other words, it’s relative to the container’s view of the world.
You’re asking Syncthing to create a directory ~/linkTest – which in turn means Syncthing will also create its marker folder ~/linkTest/.stfolder – but there’s already an existing file with the same name (your symlink). A symlink and a directory at the path ~/linkTest cannot coexist at the same time.
To include /home/ubuntu/linkTest from the host side, it either must also be mapped/overlayed into the container or it must be moved into /root/syncthing/st-sync.