Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

setcap fails on aufs systems #19

Closed
sudo-bmitch opened this issue Dec 19, 2016 · 4 comments
Closed

setcap fails on aufs systems #19

sudo-bmitch opened this issue Dec 19, 2016 · 4 comments

Comments

@sudo-bmitch
Copy link

The setcap command itself fails on some systems. I'm seeing this when trying to run a shell as the command (without changing the entrypoint) in 0.6.4):

Failed to set capabilities on file `/bin/vault' (Not supported)
usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]

 Note <filename> must be a regular (non-symlink) file.

I'm even seeing this when I pass --cap-add IPC_LOCK to the run command, running on kernel 3.16.0-4-amd64 (Debian), OS filesystems are ext4 and using the docker storage driver is aufs. Spinning up the container with a shell as my entrypoint, I can also see:

/ # getcap /bin/vault
Failed to get capabilities of file `/bin/vault' (Not supported)

Since the entrypoint starts with a set -e, I believe the script will immediately error out on the first setcap command even if PR#18 is included. Best solution may be to wrap that section of code with an if check, but I haven't had a chance to test this:

if getcap $(readlink -f $(which vault)) >/dev/null 2>&1; then
...
fi
@sudo-bmitch sudo-bmitch changed the title setcap failed on some systems setcap fails on aufs systems Dec 19, 2016
@sudo-bmitch
Copy link
Author

After a little more research, it looks like this applies to AUFS storage drivers, I'm not having the same problem on systems with the Overlay driver. See this closed/won't fix issue from Docker for more details.

@jefferai
Copy link
Member

@bmitch3020 If you can build the container locally, can you try this on AUFS with setting the SKIP_SETCAP env var non-empty and see if this bypasses the problem for you?

@jefferai
Copy link
Member

("this" = "current code" :-) )

@johnrengelman
Copy link

Just curious why this suddenly stopped work ing 0.6.4? Works fine in 0.6.2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants