Q1. What is the difference between a Docker image and a container?
An image is a read-only template; a container is a running instance of that image. - Image: built from a Dockerfile, composed of immutable layers, and stored in a registr...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (9 available).
An image is a read-only template; a container is a running instance of that image. - Image: built from a Dockerfile, composed of immutable layers, and stored in a registr...
A VM virtualises hardware: each VM runs a full guest OS on a hypervisor, so it is heavy (GBs) and slow to boot (minutes) but strongly isolated. A container virtualises th...
A Docker image is a stack of read-only layers. Each Dockerfile instruction creates a layer, and layers are shared between images and cached. Build cache: - Docker checks ...
Both persist data outside the container's writable layer, but they are managed differently. - Volumes are stored in a Docker-managed location under /var/lib/docker/volume...
Docker creates network namespaces and connects containers using drivers. - bridge (default): containers get private IPs on a virtual bridge. Same-network containers resol...
A multi-stage build uses several FROM stages in one Dockerfile. You can compile in an early stage and copy only the artefacts into a minimal final stage. ```dockerfile FR...
Attack the layers, base image, and build context. - Use a minimal base: alpine, distroless, or scratch for static binaries. - Use multi-stage builds: compile in one stage...
Both define what runs when a container starts, but they behave differently. - ENTRYPOINT sets the executable. It is hard to override and defines the container's purpose. ...
A container stops when its main process exits, so first find out why the process ended. 1. Inspect the exit code and state. ```bash docker ps -a docker inspect --format '...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.