DevOps

Docker Fundamentals

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

24 pertanyaan wawancara·
Junior
1

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

Jawaban

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?

Jawaban

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?

Jawaban

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 pertanyaan wawancara

Kuasai DevOps untuk wawancara berikutnya

Akses semua pertanyaan, flashcards, tes teknis, latihan code review dan simulator wawancara.

Mulai gratis