What is Docker? The 2-minute mental model
Docker lets you package an app with everything it needs (system libs, runtime, config) so it runs the same everywhere.
- A Docker image is a recipe (read-only).
- A container is a running instance of that image.
- You define images with a
Dockerfile→ build → run.
# Build an image from Dockerfile docker build -t hello . # Run it (maps port 3000) docker run -p 3000:3000 hello That’s it—portable apps, fewer “it works on my machine” moments.
Originally published on Bitlyst.
原文:https://www.a8q9.cn/en/article/what-is-docker-the-2-minute-mental-model-6823b4.html