Docker ও Compose চিটশিট
Docker 27+-এ কনটেইনার লাইফসাইকেল, ইমেজ বিল্ড, মাল্টি-স্টেজ Dockerfile, Compose v2 স্ট্যাক, নেটওয়ার্কিং, ভলিউম, লগ এবং নিরাপদ ক্লিনআপ কমান্ড।
যেভাবে কাজ করে
Images are immutable layered templates; containers are writable runtime processes from an image; volumes persist state across container replacement; networks wire service DNS.
সারভাইভাল কিট
যে কয়েকটি কমান্ড সবার আগে শিখতে হবে।
৪২টি কমান্ড
Run & Inspect Containers
Start containers, map ports, inspect logs, and attach interactive shells.
- অপরিহার্য
Start an ephemeral interactive container and delete it on exit
docker run --rm -it <image> <shell>কমান্ড তৈরি করুন
docker run --rm -it <image> <shell>মানগুলো ঠিক যেভাবে টাইপ করা হয়েছে সেভাবেই বসানো হয়। স্পেস বা বিশেষ অক্ষর থাকলে নিজে কোট দিয়ে নিন।
কখন ব্যবহার করবেন
Best for throwaway debugging environments without leaving stopped containers behind.
বিশ্লেষণ
- --rm
- Automatically remove container once it exits
- -it
- Interactive stdin (-i) + pseudo-TTY (-t)
উদাহরণ
docker run --rm -it alpine:3.20 sh
Images & Multi-Platform Builds
Build, tag, inspect image layers, and manage local registries.
Docker Compose v2
Orchestrate multi-container local stacks cleanly with `docker compose`.
Volumes, Networks & Files
Persist database state, connect containers by service name, and copy files.
Disk Usage & Safe Cleanup
Measure disk consumption and prune unused objects without losing data.