What are Docker volumes and why do you need them?
Volumes are storage managed by Docker that lives outside a container鈥檚 writable layer, so data such as database files survives when the container is removed or replaced.
DevOps & Cloud 路 Intern to senior
Docker is expected knowledge for DevOps engineers and increasingly for backend and full stack developers. Interviewers check that you understand what a container actually is, can write a small, secure image, and know how containers keep data and talk to each other.
3 of 5 questions match
Clear filtersVolumes are storage managed by Docker that lives outside a container鈥檚 writable layer, so data such as database files survives when the container is removed or replaced.
Use a small, pinned base image, order instructions so dependencies are cached before source code, use multi-stage builds to leave build tools out of the final image, run as a non-root user and keep secrets out of the image.
Docker Compose defines a multi-container application (services, networks and volumes) in one YAML file so you can start, stop and rebuild the whole stack with a single command, typically for local development and testing.