Skip to content

/run is mounted as tmpfs by default #26528

Closed

Description

Description

When using default entrypoint (from Dockerfile) /run is mounted by default as a tmpfs which interferes with custom mounts like /var/run/mysqld which points to /run/mysqld.

This does not happen if one overrides the entrypoint. see below for output.

Steps to reproduce the issue:

  1. git clone --single-branch -b run-creation-bug ssh://[email protected]/useltmann/docker-dev-dotdeb.git run-creation-bug
  2. cd run-creation-bug; docker build -t run-creation-bug .
  3. docker run --rm -ti run-creation-bug mount | grep run
/dev/mapper/fedora-root on /run/secrets type ext4 (rw,relatime,seclabel,data=ordered)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,context="system_u:object_r:svirt_sandbox_file_t:s0:c232,c383",size=65536k,mode=755)

Describe the results you received:
One can see there is a tmpfs mounted on /run

Describe the results you expected:

  1. docker run --rm -ti --entrypoint=mount run-creation-bug | grep run
/dev/mapper/fedora-root on /run/secrets type ext4 (rw,relatime,seclabel,data=ordered)

And here there is no tmpfs mounted on /run which i personally prefer as expected behaviour

Output of docker version:

Client:
 Version:         1.10.3
 API version:     1.22
 Package version: docker-1.10.3-50.gita612434.fc24.x86_64
 Go version:      go1.6.3
 Git commit:      a612434/1.10.3
 Built:           
 OS/Arch:         linux/amd64

Server:
 Version:         1.10.3
 API version:     1.22
 Package version: docker-1.10.3-50.gita612434.fc24.x86_64
 Go version:      go1.6.3
 Git commit:      a612434/1.10.3
 Built:           
 OS/Arch:         linux/amd64

Output of docker info:

ontainers: 20
 Running: 2
 Paused: 0
 Stopped: 18
Images: 353
Server Version: 1.10.3
Storage Driver: devicemapper
 Pool Name: fedora_home-docker--pool
 Pool Blocksize: 524.3 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: 
 Metadata file: 
 Data Space Used: 15.39 GB
 Data Space Total: 107.2 GB
 Data Space Available: 91.76 GB
 Metadata Space Used: 8.049 MB
 Metadata Space Total: 541.1 MB
 Metadata Space Available: 533 MB
 Udev Sync Supported: true
 Deferred Removal Enabled: true
 Deferred Deletion Enabled: true
 Deferred Deleted Device Count: 0
 Library Version: 1.02.122 (2016-04-09)
Execution Driver: native-0.2
Logging Driver: journald
Plugins: 
 Volume: local
 Network: bridge null host
Kernel Version: 4.7.2-201.fc24.x86_64
Operating System: Fedora 24 (Workstation Edition)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 2
CPUs: 8
Total Memory: 31.35 GiB
Name: snowball
ID: KI4M:XPJ4:QYQK:OPUL:SMQW:KKGQ:J3QF:IJUJ:5N2N:YCLX:CBO5:KFFB
Registries: docker.io (secure)

Additional environment details (AWS, VirtualBox, physical, etc.):
selinux is Enforcing

Activity

  1. cpuguy83 commented on Sep 13, 2016

    @cpuguy83
    Member

    Docker does not mount /run as tmpfs.
    It looks like you are using a patched version of Docker and not the official docker release. I suggest you raise the issue with them (looks most like RedHat's patch).

    ping @runcom

    Closing since this isn't a Docker issue.
    Please let me know if you need any help.
    You can get the official docker release from https://get.docker.com.

  2. justincormack commented on Sep 13, 2016

    @justincormack
    Contributor

    You are mounting a volume at /run/secrets which is
    a path that does not exist, so Docker will make a tmpfs mountpoint.

    Simpler reproduction is:

    moby:~# docker run --rm  -v $PWD:/nowhere/banana alpine mount | grep nowhere
    tmpfs on /nowhere/banana type tmpfs (rw,relatime)
    

    The reason you are mounting a volume is you are using a Red Hat patched version of docker which is doing this for you.

    If you make the /run path in your image it will not be a tmpfs.

  3. justincormack commented on Sep 13, 2016

    @justincormack
    Contributor

    /run exists because the Red Hat version of Docker creates it. I suggest
    testing on the upstream version to see how Docker is supposed to behave and
    file an issue with Red Hat if their version is causing you an issue.

    On 13 Sep 2016 2:23 p.m., "Ulf Seltmann" [email protected] wrote:

    @justincormack https://github.com/justincormack you are wrong:

    docker run --rm -v $PWD:/nowhere/banana alpine mount | grep nowhere

    /dev/mapper/fedora_home-home on /nowhere/banana type ext4 (rw,seclabel,relatime,data=ordered)

    also the /run folder exists in my image:

    docker run --rm -ti run-creation-bug ls /run -lad
    drwxr-xr-x. 2 root root 40 Sep 13 13:21 /run

    docker run --rm -ti --entrypoint=ls run-creation-bug /run -lad
    drwxr-xr-x. 4 root root 45 Sep 13 12:26 /run

    —
    You are receiving this because you were mentioned.
    Reply to this email directly, view it on GitHub
    #26528 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AAdcPOXpi27hEoHdNlF0Qu_v4lnztsyeks5qpqOugaJpZM4J7nDJ
    .

  4. cpuguy83 commented on Sep 13, 2016

    @cpuguy83
    Member

    @useltmann Again, this is not docker doing this.
    You should check with RedHat.

  5. runcom commented on Sep 13, 2016

    @runcom
    Member

    @cpuguy83, @justincormack I'm taking care of this in a bugzilla. @useltmann please continue the conversation over there.

  6. cpuguy83 commented on Sep 13, 2016

    @cpuguy83
    Member

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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