What if Docker mounts both parent and child paths?

< table > < thead > < tr > < th > scenario < / th > < th > Host directory-> Container directory < / th > What happens to < th >? < / th > < / tr > < / thead > < tbody > < tr > < td > scenario one < / td > < td > AA- > / dir1 simultaneously BB- > / dir1 < / td > < td > error: dir1 has been mounted to AA < / td > < / tr > < tr > < td > scenario two < / td > < td > AA- > / dir1 simultaneously BB- > / dir1/dir2 < / td > < td >? < / td > < / tr > < tr > < td > scenario 3 < / td > < td > AA- > / dir1 simultaneously AA- > / dir1/dir2 < / td > < td >? < / td > < / tr > < / tbody > < / table >

as shown in the figure, if I have tried in scenario 1, docker will report an error directly, and repeated mounting of the same directory is not allowed.
but what happens in scenario 2 and scenario 3 can be mapped properly?

Oct.13,2021
Menu