When deploying a standalone container I can mount /dev/shm as a tmpfs with custom options as follows:
docker run --name my-container -v /dev/shm --tmpfs /dev/shm:rw,nosuid,nodev,exec,size=90g my-image
However, I cannot figure out how to do the same thing when deploying a container over a swarm using docker stack deploy
. There does not appear to be any relevant information in the documentation here. With the following docker-compose.yml
version: '3.6'
services:
master:
image: "my-image"
ports:
- "8080:8080"
volumes:
- type: tmpfs
target: /dev/shm
/dev/shm
is mounted with default options. How can I mount /dev/shm
with the options (rw,nosuid,nodev,exec,size=90g)
using docker stack deploy
?