📦Container
Also known as Software Container, Linux Container, Containerized App
A sealed box that holds an app and all it needs. It runs the same anywhere.
Think of it like
It is like a lunch box. The whole meal is packed inside, so it travels well.
Example
Lucy's web app works on her laptop but breaks on the server. She packs it into a container, and now it runs the same in both places.
Why it matters
It ends the old excuse that it works on my machine. The same box runs in testing and in the real world.
Definition
Example code
console
$ docker run -d -p 8080:80 nginx
$ curl -s localhost:8080 | grep title
<title>Welcome to nginx!</title>Common mistake
Key takeaways
- 1Self-contained. It carries every file the app needs.
- 2Kept apart. Each container sees only its own space.
- 3Easy to replace. Throw one away and start a fresh copy.