Skip to content
InterviewEra
Loading account navigation
InterviewEra

InterviewEra is an AI-powered mock interview platform with adaptive follow-ups, resume-aware scoring, and structured interview preparation for campus placements and early-career hiring.

Start Mock Interview

Product

  • How It Works
  • For Teams
  • Start Mock Interview
  • Campus Placements
  • Campus Workspace
  • Help Center

Tools

  • Interview Question Generator
  • ATS Resume Checker
  • STAR Answer Builder

Resources

  • Interview Questions
  • All Resources
  • Blog
  • Community Hub
  • DSA Topic Map
  • Placement Guide
  • STAR Guide

Company

  • What is InterviewEra
  • About Us
  • Pricing
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Refund Policy

© 2026 InterviewEra. All rights reserved.

Privacy Policy|Terms & Conditions|Refund Policy
|Ranchi, Jharkhand, India
Interview Questions›Topics›Docker

DevOps

Docker Interview Questions 2026

Docker interview questions on containers, images, Dockerfile, networking, volumes, and Docker Compose for containerised deployments.

DevOps

Docker Interview Questions

Placement-oriented · Updated 2026
  1. 01

    What is the difference between a Docker image and a container?

    TechnicalEasy

    Tip: An image is an immutable, layered template (built from a Dockerfile). A container is a running, writable instance of an image with its own isolated process/network namespace. One image can spawn many containers — like a class vs its objects.

  2. 02

    How does Docker differ from a virtual machine?

    TechnicalMedium

    Tip: A VM virtualises hardware and runs a full guest OS (heavy, slow boot). Containers share the host kernel and isolate only the process/filesystem via namespaces and cgroups — lightweight, fast to start, denser. Containers trade stronger isolation for efficiency.

  3. 03

    What are Docker layers and how does build caching work?

    TechnicalMedium

    Tip: Each Dockerfile instruction creates a cached layer. Docker reuses a layer if the instruction and its inputs are unchanged. Order matters: copy dependency manifests and install BEFORE copying source code, so editing code does not bust the dependency-install cache.

  4. 04

    What is a multi-stage build and why use it?

    TechnicalMedium

    Tip: A multi-stage build uses multiple FROM stages — e.g. build in a heavy SDK image, then COPY only the compiled artifact into a slim runtime image. This shrinks the final image, removes build tools from production, and improves security and pull speed.

  5. 05

    How do you persist data in Docker?

    TechnicalMedium

    Tip: Container filesystems are ephemeral. Use named volumes (managed by Docker, portable, preferred for databases) or bind mounts (map a host path, good for dev). tmpfs keeps data in memory only. Never store stateful data in the container layer.

  6. 06

    What is Docker Compose used for?

    TechnicalEasy

    Tip: Compose defines and runs multi-container apps from a single YAML file (services, networks, volumes, env). docker compose up starts the whole stack (e.g. app + Postgres + Redis) with one command — ideal for local dev and integration testing.

  7. 07

    How do you reduce Docker image size?

    TechnicalMedium

    Tip: Use a slim/alpine or distroless base, multi-stage builds, combine RUN steps and clean package caches in the same layer, add a .dockerignore, and avoid installing unnecessary tools. Smaller images pull faster and have a smaller attack surface.

  8. 08

    What is the difference between CMD and ENTRYPOINT?

    TechnicalMedium

    Tip: ENTRYPOINT sets the fixed executable; CMD provides default arguments (or a default command). At runtime, args after docker run override CMD but are appended to ENTRYPOINT. Use ENTRYPOINT for the binary, CMD for default flags — together they make a configurable container.

Practice Docker questions with your own resume

InterviewEra generates role-specific questions using your actual projects and skills. Get scored feedback on technical depth, clarity, and structure — free to start.

Start free mock interviewFree question generator

Roles that need Docker

  • Backend Developer questions
  • DevOps Engineer questions
  • Cloud Engineer questions

Related devops topics

  • Git questions
  • Linux questions
  • Kubernetes questions

Practice tools

  • Interview question generator
  • ATS resume checker
  • STAR answer builder

Guides and resources

  • All interview questions
  • HR interview answer tips
  • STAR method with examples