Docker - Logging and MonitoringWhich Dockerfile instruction correctly defines a health check that runs every 30 seconds?AHEALTHCHECK CMD --interval=30s curl -f http://localhost/ || exit 1BHEALTHCHECK CMD curl -f http://localhost/ || exit 1 --interval=30sCHEALTHCHECK --interval=30s CMD curl -f http://localhost/ || exit 1DHEALTHCHECK INTERVAL 30 CMD curl -f http://localhost/ || exit 1Check Answer
Step-by-Step SolutionSolution:Step 1: Understand HEALTHCHECK syntaxThe correct syntax places options like --interval before CMD.Step 2: Identify correct placementHEALTHCHECK --interval=30s CMD curl -f http://localhost/ || exit 1 correctly uses --interval=30s before CMD.Final Answer:HEALTHCHECK --interval=30s CMD curl -f http://localhost/ || exit 1 -> Option CQuick Check:HEALTHCHECK --interval=30s CMD curl -f http://localhost/ || exit 1 syntax matches Dockerfile HEALTHCHECK format [OK]Quick Trick: Options like --interval go before CMD in HEALTHCHECK [OK]Common Mistakes:Placing options after CMDUsing incorrect keywords like INTERVAL instead of --intervalMisordering the command parts
Master "Logging and Monitoring" in Docker9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Docker Quizzes Docker Security - Capabilities and privilege control - Quiz 8hard Docker Security - Read-only filesystem containers - Quiz 13medium Docker Swarm - Swarm mode initialization - Quiz 5medium Docker in CI/CD - Running tests in containers - Quiz 7medium Docker in CI/CD - Deploying from CI/CD pipeline - Quiz 14medium Docker in CI/CD - GitLab CI with Docker - Quiz 11easy Image Optimization - Why image optimization matters - Quiz 11easy Image Optimization - Reducing image size strategies - Quiz 15hard Production Patterns - Sidecar container pattern - Quiz 15hard Resource Management - Resource monitoring per container - Quiz 13medium