Skip to main content

What is the difference between docker-compose up and docker-compose up --build?

Junior Docker
Quick Answer docker compose up starts existing containers (or creates them if they don't exist) using the current images. docker compose up --build forces Docker to rebuild images before starting รขโ‚ฌโ€ picks up Dockerfile changes. Without --build, code changes in your Dockerfile won't be reflected in running containers.

Answer

up uses existing images. up --build forces image rebuild before starting services.
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