using the tmpfs option in the compose file makes the directory not very useful in some scenarios. it gets mounted as:
tmpfs on /src/core/node_modules type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
which means it:
user
option - it's root:root, mode 755.noexec
flagI suggest removing noexec
and making it mode 777
ok, it's possible to specify the options with:
tmpfs:
- /tmp:exec,mode=777
I've tried mode=777
and mode=1777
but the actual set permissions are still 755
. Inspecting the running container reveals, that the option was set on the container with "/run": "exec,mode=1777"
correctly, but somehow the permissions weren't set on /tmp
.
for me I had to change the permissions on the host filesystem directory I was mounting the tmpfs over
Is docker using the permissions mount options of tmpfs after start a container?
In my tests the permissions only works when creating the container and the underlying directory does not exist.
I think the expected and correct behavior should be that tmpfs should always honor the mount options permissions.
I couldn't get it to respect the mode=777
but what worked in my scenario was setting the user and group mount options:
docker run --tmpfs /app/tmp:uid=1000,gid=1000 ...
Most helpful comment
ok, it's possible to specify the options with: