I have 1 process that writes to a specific section of shared memory (i.e. "/falcon" )in a docker container.
Docker image: dockersharedmemory/shmclient
I have another process that initially creates and reads the same section of shared memory(i.e. "/falcon" ) every second in another docker container.
Docker image: dockersharedmemory/shmserver
When I run the two containers using the following commands I am able to read and write in each container respectfully:
docker run -d -v /dev:/dev dockersharedmemory/shmserver
docker run -d -v /dev:/dev dockersharedmemory/shmclient
When I use the "--ipc" option per documentation i can't get it to work:
docker run -d --ipc=host dockersharedmemory/shmserver
docker run -d --ipc=host dockersharedmemory/shmclient
neither
docker run -d dockersharedmemory/shmserver
drunk_feynman
docker run -d --ipc=container:drunk_feynman dockersharedmemory/shmclient
happy_fermi
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8/1.4.1
OS/Arch (client): linux/amd64
Server version: 1.4.1
Server API version: 1.16
Go version (server): go1.3.3
Git commit (server): 5bc2ff8/1.4.1
I have a working example now with a combination of the commands on the host by punching huge holes in the container with a combination of volumes and ipc:
docker run -d -v /dev/shm:/dev/shm --ipc=host dockersharedmemory/shmserver
docker run -d -v /dev/shm:/dev/shm --ipc=host dockersharedmemory/shmclient
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…