Skip to main content

Why can a container’s time drift from the host clock?

Senior Docker
Quick Answer Containers share the host kernel and use the host's hardware clock. The container cannot modify the system clock (CAP_SYS_TIME is dropped by default). However, virtual machine environments running Docker can have clock drift between the VM's clock and the host. NTP sync inside the VM (not the container) is the fix.

Answer

Timezone mounts or custom configurations may cause drift from host time.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice