Docker - SecurityYou scanned an image and found vulnerabilities in a package that is not used by your application. What is the best practice to handle this?ADisable scanning for that imageBCreate a custom Dockerfile to remove or update the unused packageCSwitch to a different base image without scanningDIgnore the vulnerability since the package is unusedCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand vulnerability contextEven unused packages can pose risks if present in the image.Step 2: Apply best practiceRemoving or updating unused vulnerable packages via Dockerfile reduces risk.Final Answer:Create a custom Dockerfile to remove or update the unused package -> Option BQuick Check:Remove unused vulnerable packages via Dockerfile = D [OK]Quick Trick: Remove or update unused vulnerable packages in Dockerfile [OK]Common Mistakes:Ignoring vulnerabilities even if unusedSkipping scans by switching imagesDisabling scanning instead of fixing
Master "Security" in Docker9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Docker Quizzes Docker Security - Capabilities and privilege control - Quiz 1easy Docker Security - Security benchmarks (CIS Docker) - Quiz 2easy Docker Swarm - Manager and worker nodes - Quiz 3easy Docker Swarm - Deploying services in Swarm - Quiz 9hard Docker in CI/CD - Running tests in containers - Quiz 3easy Image Optimization - Why image optimization matters - Quiz 3easy Image Optimization - Scratch base image for minimal containers - Quiz 1easy Logging and Monitoring - Centralized logging setup - Quiz 6medium Resource Management - Storage driver options - Quiz 4medium Resource Management - Storage driver options - Quiz 9hard