Skip to content

Instantly share code, notes, and snippets.

@benok
Last active May 14, 2019 07:20
Show Gist options
  • Save benok/520ece006674896d6b52d6a15b22dbe0 to your computer and use it in GitHub Desktop.
Save benok/520ece006674896d6b52d6a15b22dbe0 to your computer and use it in GitHub Desktop.
check capability (useful checking inside docker container)
#!/bin/sh
# how can a docker container check if it has a capability - Stack Overflow
# https://stackoverflow.com/questions/46702043/how-can-a-docker-container-check-if-it-has-a-capability
# need to install capsh (libcap2-bin for debian)
for i in $(capsh --print | grep "Current:" | cut -d ' ' -f3 | sed 's/,/ /g'); do
echo $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment