Skip to main content

Why shouldn’t you install unnecessary packages inside a container?

Entry Docker
Quick Answer Every package you install adds to the image size, increases the attack surface, and takes longer to build and pull. A container should do one job. Extra tools (curl, wget, vim) are convenient during dev but become security risks in production รขโ‚ฌโ€ they give an attacker more tools to work with if they break in.

Answer

Unnecessary packages increase image size, attack surface, and build time. Production images should be minimal.
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