4

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!

Zhi
  • 61
  • 3

1 Answers1

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.

Asclepius
  • 57,944
  • 17
  • 167
  • 143
kaylum
  • 13,833
  • 2
  • 22
  • 31