Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make tmpfs permissions 777 and remove noexec flag #3425

Closed
gdamjan opened this issue May 6, 2016 · 6 comments
Closed

make tmpfs permissions 777 and remove noexec flag #3425

gdamjan opened this issue May 6, 2016 · 6 comments

Comments

@gdamjan
Copy link

gdamjan commented May 6, 2016

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:

  • can't be written to if using the user option - it's root:root, mode 755.
  • can't execute stuff from it, cause of the noexec flag

I suggest removing noexec and making it mode 777

@gdamjan
Copy link
Author

gdamjan commented May 9, 2016

ok, it's possible to specify the options with:

tmpfs:
  - /tmp:exec,mode=777

@gdamjan gdamjan closed this as completed May 9, 2016
@thasmo
Copy link

thasmo commented Sep 27, 2016

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.

@davidvanlaatum
Copy link

for me I had to change the permissions on the host filesystem directory I was mounting the tmpfs over

@mauricios
Copy link

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.

@oxplot
Copy link

oxplot commented Sep 20, 2018

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 ...

sheeeng added a commit to sheeeng/docker.github.io that referenced this issue Nov 26, 2019
it-is-a-robot pushed a commit to openeuler-mirror/compass-ci that referenced this issue Jan 30, 2021
error messgae:
./configure
permission denied

[why]
tmpfs default option (rw,nosuid,noexec,nodev)
can't execute stuff from it cause of the noexec flag

refer-to:
docker/compose#3425

Signed-off-by: Xiao Shenwei <xiaoshenwei96@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@gdamjan @thasmo @oxplot @mauricios @davidvanlaatum and others