Information
IPC (POSIX/SysV IPC) namespace provides separation of named shared memory segments, semaphores and message queues.IPC namespace on the host thus should not be shared with the containers and should remain isolated.IPC namespace provides separation of IPC between the host and containers. If the host's IPC namespace is shared with the container, it wouldbasically allow processes within the container to see all of the IPC on the host system. This breaks the benefit of IPC level isolation between the host and the containers. Someone having access to the container can eventually manipulate the host IPC. This can be catastrophic. Hence, do not share the host's IPC namespace with the containers.
Solution
Do not start a container with '--ipc=host' argument.For example, do not start a container as below-
docker run --interactive --tty --ipc=host centos /bin/bash
Impact-
Shared memory segments are used to accelerate inter-process communication. It is commonly used by high performance applications. If such applications are containerized into multiple containers, you might need to share the IPC namespace of the containers to achieve high performance. In such cases, you should still be sharing container specific IPC namespaces only and not the host IPC namespace. You may share the container's IPC namespace with other container as below-
$>docker run <Run arguments> --ipc=container-$INSTANCE_ID <Container Image Name or ID> <Command>
For example,
docker run --interactive --tty --ipc=container-e3a7a1a97c58 centos /bin/bash
Default Value-
By default, all containers have the IPC namespace enabled and host IPC namespace is not shared with any container.