Docker - SecurityYou want to run a container with minimal privileges but allow it to change the system clock. Which command achieves this?Adocker run --cap-drop ALL --cap-add SYS_TIME myimageBdocker run --privileged myimageCdocker run --cap-add SYS_TIME myimageDdocker run --cap-drop SYS_TIME myimageCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand minimal privileges with specific capabilityDropping all capabilities and adding only SYS_TIME limits privileges but allows changing system clock.Step 2: Compare other options--privileged grants all capabilities, --cap-add SYS_TIME alone does not drop others, and --cap-drop SYS_TIME removes the needed capability.Final Answer:docker run --cap-drop ALL --cap-add SYS_TIME myimage -> Option AQuick Check:Drop all then add SYS_TIME for minimal clock change rights [OK]Quick Trick: Drop all then add SYS_TIME for clock changes only [OK]Common Mistakes:Using --privileged for minimal privilegesNot dropping all capabilities firstRemoving SYS_TIME capability accidentally
Master "Security" in Docker9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Docker Quizzes Docker Security - Read-only filesystem containers - Quiz 11easy Docker Swarm - Why orchestration matters - Quiz 2easy Docker Swarm - Swarm mode initialization - Quiz 9hard Image Optimization - Reducing image size strategies - Quiz 9hard Logging and Monitoring - Why monitoring containers matters - Quiz 15hard Logging and Monitoring - Container metrics collection - Quiz 12easy Production Patterns - Sidecar container pattern - Quiz 5medium Production Patterns - Backup and restore strategies - Quiz 8hard Production Patterns - Container orchestration in production - Quiz 3easy Resource Management - CPU limits and reservations - Quiz 10hard