Skip to main content

Why is building images directly on production servers discouraged?

Senior Docker
Quick Answer Building on production servers means the build process (which downloads packages, compiles code, runs scripts) runs on the same machine serving user traffic. A bad build can consume CPU/RAM, introduce partially-built artifacts, or install unwanted packages. Build on CI servers, push the image, pull and run on production.

Answer

Build contexts may leak secrets and introduce supply-chain risks.
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