DevOps

Docker Fundamentals

Containers, images, Dockerfile, docker-compose, volumes, networks, registries (ECR/GCR/ACR), troubleshooting containers

24 pytań z rozmów·
Junior
1

What is the main difference between a Docker container and a virtual machine?

Odpowiedź

A container shares the host operating system kernel and only isolates processes, while a virtual machine includes a complete OS with its own kernel. Containers are therefore much lighter (a few MB vs several GB) and start in seconds instead of minutes. This architectural difference makes containers ideal for rapid deployments and horizontal scalability.

2

What is a Docker image?

Odpowiedź

A Docker image is an immutable, read-only template that contains everything needed to run an application: code, runtime, libraries, environment variables, and configuration files. Images are composed of stacked layers, each layer representing a filesystem modification. This layered architecture enables efficient reuse and sharing of images between containers.

3

Which Dockerfile instruction defines the base image?

Odpowiedź

The FROM instruction defines the base image to build from. It must be the first instruction (after optional ARG) in a Dockerfile. For example, FROM node:18-alpine uses the Node.js 18 image based on Alpine Linux. Choosing an appropriate base image (size, security, compatibility) is crucial for optimizing builds and reducing vulnerabilities.

4

What is the difference between CMD and ENTRYPOINT in a Dockerfile?

5

Which Dockerfile instruction copies files from the host to the image?

+21 pytań z rozmów

Opanuj DevOps na następną rozmowę

Uzyskaj dostęp do wszystkich pytań, flashcards, testów technicznych, ćwiczeń code review i symulatorów rozmów.

Zacznij za darmo