@thaJeztah suggests to use a --mount option as an workaround of --shm-size like that:
docker service create \
--name tmpfstest \
--mount type=tmpfs,dst=/dev/shm,tmpfs-size=1000000000 \
--tty \
debian:stretch-slim cat
But I can't find anything about how to set the tmpfs-size in the doc about volume-long-syntax. I think this feature should be supported.
Thanks for opening this!
/cc @vdemeester @dnephin
What are you peeps thinking the docker-compose syntax should look like?
Something like this?
volumes:
- type: tmpfs
size: 10000
I think it should match the existing types (bind, volume):
volumes:
- type: tmpfs
target: /tmp
tmpfs:
size: 10000
Sounds like it's been fixed by https://github.com/docker/cli/pull/808
Looks tmpfs-mode one is not implemented yet. Only tmpfs: size: ... is implemented.
@ypresto could you open a new issue, so that we don't loose sight?
Actually the supported mount options are the same as the Linux default mount flags. If you do not specify any options, the systems uses the following options: rw,noexec,nosuid,nodev,size=65536k, it's just that the documentation is incorrect.
This actually does what it's supposed to:
version: "2.4"
services:
my_app:
image: my_app
read_only: true
restart: always
tmpfs:
- /run:mode=770,size=1k,uid=200,gid=10000
It'll set /run mode to 770 with a 1k size limit and owned by uid 200 and gid 10000
Most helpful comment
Actually the supported mount options are the same as the Linux default mount flags. If you do not specify any options, the systems uses the following options:
rw,noexec,nosuid,nodev,size=65536k, it's just that the documentation is incorrect.This actually does what it's supposed to:
It'll set /run mode to 770 with a 1k size limit and owned by uid 200 and gid 10000