DevOps

Docker Fundamentals

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

24 면접 질문·
Junior
1

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

답변

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?

답변

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?

답변

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 면접 질문

다음 면접을 위해 DevOps을 마스터하세요

모든 질문, flashcards, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기