If I bind mount a directory when I start my linux container, and then create a unix domain socket within that mount inside the container:
ubuntu@docker-desktop:~$ socat unix-listen:./test.sock,fork STDOUT
^Z
[1]+ Stopped socat unix-listen:./test.sock,fork STDOUT
ubuntu@docker-desktop:~$ bg
and then look at it:
ubuntu@docker-desktop:~$ ls -l |grep test
ls: cannot access ‘test.sock’: Invalid argument
s??? ? ? ? ? ? test.sock
If I do the same on the container’s file system instead of on the mount:
ubuntu@docker-desktop:/tmp$ socat unix-listen:./test.sock,fork STDOUT
^Z
[2]+ Stopped socat unix-listen:./test.sock,fork STDOUT
ubuntu@docker-desktop:/tmp$ bg
[2]+ socat unix-listen:./test.sock,fork STDOUT &
ubuntu@docker-desktop:/tmp$ ls -l
total 0
srwxr-xr-x 1 ubuntu ubuntu 0 Jul 23 20:13 test.sock
Does anyone know why this is?
Thanks!