Permissions on tmpfs mounts reset after container restart · Issue #138 · docker/for-linux (original) (raw)

Expected behavior

The tmpfs mount's permissions should be exactly the same as when they were initially set.

Actual behavior

On the first start of the container, the permissions are correctly set. After a restart they are always reset back to 755.

Steps to reproduce the behavior

$ docker run --name test --tmpfs /test debian stat -c %a /test && docker start -a test && docker rm test
1777
755
test
$ docker run --name test --mount type=tmpfs,destination=/test,tmpfs-mode=1777 debian stat -c %a /test && docker start -a test && docker rm test
1777
755
test
$ docker run --name test --mount type=tmpfs,destination=/test,tmpfs-mode=0444 debian stat -c %a /test && docker start -a test && docker rm test
444
755
test

Output of docker version:

Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:42:18 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:56 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 1
Server Version: 17.09.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 3f2f8b84a77f73d38244dd690525642a72156c64
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-97-generic
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 992.1MiB
Name: ubuntu-xenial
ID: I4LX:P2UV:RBV5:CF5A:H6Y2:UN2T:ISCF:ETL7:XRT3:J7J5:6O5B:WKGY
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.)

Package: virtualbox-5.1
Version: 5.1.30-118389~Debian~stretch