Assuming that the current file is somewhere under /srv/<container>/
fun! DockerGf ()
" save the current register contents
let old_reg = @"
" get the path under the cursor
norm! ByE
" remove the leading slash if any
let path = substitute(@",'^/\?','','')
" restore the previous register contents
let @" = old_reg
" get the container directory path
let parent = substitute(expand('%:p'),'^/srv/[^/]*/\zs.*','','')
" go to the file
exe 'edit ' . parent . path
endfun
" define custom mapping to open path under cursor in container
nnor ,dgf :call DockerGf()<cr>
If the assumption that the current file is under the container directory may be
wrong you can use a global variable with the path to the container instead:
:let g:container_path = '/srv/<container>/'
and replace the two lines in the function above containing "parent" with
just
exe 'edit ' . g:container_path . path
There may be more elegant ways...