Why Docker build need to use /dev/shm?
Asked Answered
H

1

6

I noticed the command docker build has a parameter --shm-size bytes which uses to set the size of /dev/shm. But I don't know why the docker build needs to use the shared memory.

The docker build command just follows the Dockerfile and run a set of intermediate containers to build the target container environments and commit them as an image. In this process, all parameters and commands in Dockerfile are resolved and packaged as a struct that passes in different components (docker client, docker daemon, containerd, runc ...) . It seems that docker build doesn't need a shared memory to pass the information.

But why docker build provides this parameter --shm-size bytes? And maybe I have some misunderstanding about this process. Please correct me. Thanks!

Hydrazine answered 8/1, 2020 at 22:14 Comment(0)
N
3

The --shm-size option of docker build sets the /dev/shm size for intermediate containers that are started as part of the build process.

Norfolk answered 8/1, 2020 at 22:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.