Skip to content
DockerKonteynerOptimizasyonBaşlangıç

What Is Docker? The Fundamentals

July 1, 2026 · 10 min read

Last verified: 2026-07-17

Frequently Asked Questions

What is Docker?

Docker is a container technology that packages your app together with everything it needs to run (libraries, runtime, system tools) into one artifact. That artifact runs identically on your laptop, a server, or the cloud, eliminating the 'works on my machine but not on the server' problem.

What is the difference between a Docker image and a container?

An image is a frozen, immutable template of your app. A container is a live, running instance of that image. You can run as many containers as you want from one image, like creating many objects from one class.

What is a Dockerfile?

A Dockerfile is a text file where you describe how to build an image step by step. It defines the base image with FROM, plus commands like WORKDIR, COPY, and RUN for installing dependencies, and CMD for the command to run.

How do you shrink a Docker image size?

Using a multi-stage build reduces image size significantly: one stage compiles the app and a second stage takes only the runtime output. In the example, a naive 912MB image drops to 92MB (about 90% smaller) with multi-stage and an alpine base.

How do I prevent secrets from leaking into a Docker image?

'COPY . .' grabs everything into the image, so secret files like env, .aws, and .git can leak. Adding a .dockerignore file (node_modules, .git, .env) both shrinks the image and prevents secret leakage.

Reading isn't enough — do it.

Practice these topics in an interactive terminal in your browser.