Data Engineering

Docker - Fundamentals

Dockerfile, images, containers, volumes, networks, registries, multi-stage builds, best practices

25 interview questionsยท
Junior
1

What is a Docker container?

Answer

A Docker container is a runnable instance of a Docker image. It encapsulates an application and all its dependencies in an isolated and portable environment. Unlike virtual machines, containers share the host system's kernel, making them much lighter and faster to start. Each container has its own filesystem, network stack, and isolated processes.

2

What is a Docker image?

Answer

A Docker image is a read-only template that contains the instructions for creating a container. It includes the application code, libraries, dependencies, tools, and files needed for execution. Images are built from a Dockerfile and are composed of stacked layers. Each Dockerfile instruction creates a new layer, enabling efficient sharing and reuse of common layers between images.

3

What is the purpose of a Dockerfile?

Answer

A Dockerfile is a text file containing a series of instructions to automatically build a Docker image. Each instruction (FROM, RUN, COPY, etc.) creates a layer in the final image. The Dockerfile allows you to declaratively and reproducibly define an application's runtime environment. It ensures the image will be identical on every build, facilitating deployment and team collaboration.

4

Which Dockerfile instruction specifies the base image?

5

What is the difference between COPY and ADD instructions in a Dockerfile?

+22 interview questions

Master Data Engineering for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free