Docker Security

docker run --cap-drop

Reduce granted Linux capabilities. Start with none for compatible workloads, and review any additional capability requirement. Does not replace other controls. Requested flags and effective process security state are distinct.

Formal Syntax & Structure

docker syntaxdocker
docker run --cap-drop ALL IMAGE [COMMAND]

Parameters & Attributes

NameTypeDescription
ALLstringDrop all configured capability grants.

Working Example

Example Snippetdocker
docker run --rm --pull=never --network none --user 10001:10001 --cap-drop ALL busybox:1.36 echo ok
Docker Reference