Skip to content

--shm-size in docker build for Mac is not accepting the values indicated #418

@rpesciotta

Description

@rpesciotta
  • I have tried with the latest version of my channel (Stable)
  • I have uploaded Diagnostics
  • Diagnostics ID: 80E045E9-84C3-4BA1-A4EE-2A443EA5AFF8/20201016192548

Expected behavior

--shm-size=XXX should set /dev/shm to the desired value

Actual behavior

any value for --shm-size sets the value to 64M, only

Information

  • macOS Version: macOS Catalina 10.15.7
  • docker for mac version: 2.4.0.0 (48506) Stable

Steps to reproduce the behavior

  1. Use the sample Dockerfile, that stores the allocated size inside /dev/shm during build time in a temp file that can be read on the container when running
FROM busybox
RUN df -kh /dev/shm > /tmp/output
CMD cat /tmp/output
  1. Build the image passing the --shm-size tag
docker build --shm-size=1g -t test .
[+] Building 1.6s (6/6) FINISHED
=> [internal] load build definition from Dockerfile
=> => transferring dockerfile: 111B
=> [internal] load .dockerignore
=> => transferring context: 2B
=> [internal] load metadata for docker.io/library/busybox:latest
=> CACHED [1/2] FROM docker.io/library/busybox@sha256:a9286defaba7b3a519d585ba0e37d0b2cbee74ebfe590960b0b1d6a5e97d1e1d
=> [2/2] RUN df -kh /dev/shm > /tmp/output
=> exporting to image
=> => exporting layers
=> => writing image sha256:2f450e57281dca99454df4ad8becd0fcb2e1153470b5ed365aa946042d001605
=> => naming to docker.io/library/test
  1. Run the generated image, which will print the size of /dev/shm stored in the temporary text file during build
docker run test
Filesystem                Size      Used Available Use% Mounted on
shm                      64.0M         0     64.0M   0% /dev/shm

Tried with different values for the --shm-size parameter, but in all cases only 64M is allocated to /dev/shm.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions