• Kir Kolyshkin's avatar
    Use shareable IPC for sandbox container · 1dca64ff
    Kir Kolyshkin authored
    Currently, Docker make IPC of every container shareable by default,
    which means other containers can join it's IPC namespace. This is
    implemented by creating a tmpfs mount on the host, and then
    bind-mounting it to a container's /dev/shm. Other containers
    that want to share the same IPC (and the same /dev/shm) can also
    bind-mount the very same host's mount.
    
    Now, since https://github.com/moby/moby/commit/7120976d7
    (https://github.com/moby/moby/pull/34087) there is a possiblity
    to have per-daemon default of having "private" IPC mode,
    meaning all the containers created will have non-shareable
    /dev/shm.
    
    For shared IPC to work in the above scenario, we need to
    explicitly make the "pause" container's IPC mode as "shareable",
    which is what this commit does.
    
    To test: add "default-ipc-mode: private" to /etc/docker/daemon.json,
    try using kube as usual, there should be no errors.
    Signed-off-by: 's avatarKir Kolyshkin <kolyshkin@gmail.com>
    1dca64ff
docker_sandbox.go 26.5 KB