Docker Basics
This page explains Docker for a tester: what containers, images, and registries are, how the Docker client and daemon run a container, and the first commands, with a practice run that you can repeat on your own machine. It ends with the ways that a tester uses containers. Docker Images and Compose builds on it.
13 min read13 মিনিটে পড়া যায় · 7 sections7টি সেকশন · 23 sources23টি সোর্স · updated Nov 2026আপডেট: Nov 2026
Image layers and the writable layerইমেজ লেয়ার আর writable লেয়ার
Run a container, write a file, remove it, and see what survives.একটা কন্টেইনার চালান, একটা ফাইল লিখুন, কন্টেইনার মুছুন, আর দেখুন কী টিকে থাকে।
You’ll learnআপনি শিখবেন
- Image layers are read-onlyইমেজ লেয়ার শুধু পড়ার
- Each container adds one thin writable layerপ্রতিটা কন্টেইনার একটা পাতলা writable লেয়ার যোগ করে
- A stopped container keeps its layerথামা কন্টেইনার তার লেয়ার রাখে
- docker rm loses the file unless a volume holds itভলিউম না থাকলে docker rm ফাইল হারায়
What it is
Docker Engine is an open source containerization technology for building and containerizing your applications Source 1সোর্স 1. A container is an ordinary process on your computer, such as a Node.js server, that runs in isolation Source 2সোর্স 2. Because everything the app needs is inside, a container doesn't depend on what is installed on your machine Source 2সোর্স 2.
Three words to know.
| Word | What it is |
|---|---|
| Container | An ordinary process on your computer, such as a Node.js server, that runs in isolation Source 2সোর্স 2. Its files come from an image Source 2সোর্স 2 |
| Image | A package of everything a container needs to start: the operating system files, the language runtime, the app's dependencies and code, and settings such as which command to run Source 2সোর্স 2 |
| Registry | A service that stores images so anyone with access can pull them Source 2সোর্স 2. Docker Hub (docker.io) is Docker's public registry and the default one Source 2সোর্স 2. Docker Hub provides a container registry for storing, managing, and sharing Docker images Source 4সোর্স 4 |
Why a tester cares. Docker's guide says that each difference between machines is a chance for the app to work on one machine and fail on another Source 2সোর্স 2. Ten containers started from the same image start from exactly the same files, today or next month Source 2সোর্স 2. Delete a container and nothing else on your machine changes Source 2সোর্স 2.
Containers and virtual machines. A virtual machine (VM) also isolates software, but it does so by pretending to be a whole computer Source 2সোর্স 2. Every VM boots its own complete operating system, including its own kernel, the core of the operating system that talks to the hardware Source 2সোর্স 2. A container is still a process, so every container on a machine shares that machine's kernel Source 2সোর্স 2. There is no operating system to boot, which is why a container starts in about a second and why one machine can run many of them Source 2সোর্স 2. The trade-off is that a VM's isolation is stronger: containers that share a kernel are separated by that kernel, while VMs are separated by the hardware boundary the hypervisor creates Source 2সোর্স 2. In practice, you'll often use both Source 2সোর্স 2. Cloud servers are usually VMs that run many containers each Source 2সোর্স 2.
সহজ English
Docker Engine is an open source technology for building your applications and putting them into containers Source 1সোর্স 1. A container is an ordinary process on your computer, such as a Node.js server, that runs in isolation Source 2সোর্স 2. Because everything the app needs is inside, a container does not depend on what is installed on your machine Source 2সোর্স 2.
Three words to know.
| Word | What it is |
|---|---|
| Container | An ordinary process on your computer, such as a Node.js server, that runs in isolation Source 2সোর্স 2. Its files come from an image Source 2সোর্স 2 |
| Image | A package of everything that a container needs to start: the operating system files, the language runtime, the app's dependencies and code, and settings such as which command to run Source 2সোর্স 2 |
| Registry | A service that stores images, so that anyone with access can pull them Source 2সোর্স 2. Docker Hub (docker.io) is Docker's public registry, and it is the default one Source 2সোর্স 2. Docker Hub has a container registry for storing, managing, and sharing Docker images Source 4সোর্স 4 |
Why a tester cares. Docker's guide says that each difference between machines is a chance for the app to work on one machine and fail on another Source 2সোর্স 2. Ten containers that start from the same image start from exactly the same files, today or next month Source 2সোর্স 2. When you delete a container, nothing else on your machine changes Source 2সোর্স 2.
Containers and virtual machines. A virtual machine (VM) also keeps software apart, but it does so by pretending to be a whole computer Source 2সোর্স 2. Every VM starts its own complete operating system, including its own kernel, the core of the operating system that talks to the hardware Source 2সোর্স 2. A container is still a process, so every container on a machine shares that machine's kernel Source 2সোর্স 2. There is no operating system to start, which is why a container starts in about a second and why one machine can run many of them Source 2সোর্স 2. The price is that a VM keeps things apart more strongly: containers that share a kernel are kept apart by that kernel, while VMs are kept apart by the hardware boundary that the hypervisor creates Source 2সোর্স 2. In practice, you will often use both Source 2সোর্স 2. Cloud servers are usually VMs that each run many containers Source 2সোর্স 2.
বাংলা ব্যাখ্যা
Docker Engine হলো আপনার application build আর containerize করার একটা open source containerization technology Source 1সোর্স 1। container হলো আপনার computer-এর একটা সাধারণ process, যেমন একটা Node.js server, যা isolation-এ চলে Source 2সোর্স 2। app-এর যা যা লাগে সবই ভেতরে থাকে, তাই আপনার machine-এ কী install করা আছে তার ওপর container নির্ভর করে না Source 2সোর্স 2।
তিনটা শব্দ জানুন।
| শব্দ | এটা কী |
|---|---|
| Container | আপনার computer-এর একটা সাধারণ process, যেমন একটা Node.js server, যা isolation-এ চলে Source 2সোর্স 2। এর file আসে একটা image থেকে Source 2সোর্স 2 |
| Image | একটা container শুরু করতে যা যা লাগে তার একটা package: operating system-এর file, language runtime, app-এর dependency ও code, আর কোন command চালাতে হবে এর মতো setting Source 2সোর্স 2 |
| Registry | image রাখার একটা service, যাতে access আছে এমন যে কেউ সেগুলো pull করতে পারে Source 2সোর্স 2। Docker Hub (docker.io) হলো Docker-এর public registry আর default registry Source 2সোর্স 2। Docker Hub, Docker image রাখা, পরিচালনা করা ও share করার জন্য একটা container registry দেয় Source 4সোর্স 4 |
একজন tester-এর কেন জানা দরকার। Docker-এর guide বলে, machine-গুলোর মধ্যে প্রতিটা পার্থক্য একটা সুযোগ, যাতে app এক machine-এ কাজ করে আর অন্য machine-এ ব্যর্থ হয় Source 2সোর্স 2। একই image থেকে শুরু হওয়া দশটা container ঠিক একই file নিয়ে শুরু হয়, আজ হোক বা আগামী মাসে Source 2সোর্স 2। একটা container মুছে ফেললে আপনার machine-এর আর কিছু বদলায় না Source 2সোর্স 2।
Container আর virtual machine। একটা virtual machine (VM)-ও software আলাদা রাখে, কিন্তু সেটা করে নিজেকে একটা পুরো computer হিসেবে দেখিয়ে Source 2সোর্স 2। প্রতিটা VM নিজের পুরো operating system boot করে, তার নিজের kernel-সহ, যা operating system-এর সেই মূল অংশ, যেটা hardware-এর সাথে কথা বলে Source 2সোর্স 2। container তবু একটা process, তাই একটা machine-এর প্রতিটা container সেই machine-এর kernel share করে Source 2সোর্স 2। boot করার মতো কোনো operating system নেই, আর সেজন্যই একটা container প্রায় এক সেকেন্ডে শুরু হয়, এবং একটা machine অনেকগুলো চালাতে পারে Source 2সোর্স 2। বিনিময়ে VM-এর isolation বেশি শক্ত: kernel share করা container-গুলো সেই kernel দিয়ে আলাদা থাকে, আর VM-গুলো hypervisor-এর তৈরি করা hardware-এর সীমানা দিয়ে আলাদা থাকে Source 2সোর্স 2। বাস্তবে আপনি প্রায়ই দুটোই ব্যবহার করবেন Source 2সোর্স 2। Cloud server সাধারণত VM, আর প্রতিটা অনেকগুলো container চালায় Source 2সোর্স 2।
How it works
Client and daemon. Docker Engine acts as a client-server application Source 1সোর্স 1. It has a server with a long-running daemon process, dockerd Source 1সোর্স 1. It has APIs, which specify interfaces that programs can use to talk to and instruct the Docker daemon Source 1সোর্স 1. It has a command line interface (CLI) client, docker Source 1সোর্স 1. The CLI uses Docker APIs to control or interact with the Docker daemon through scripting or direct CLI commands Source 1সোর্স 1. The daemon creates and manages Docker objects, such as images, containers, networks, and volumes Source 1সোর্স 1. The Docker Engine API is a RESTful API accessed by an HTTP client such as wget or curl, or the HTTP library which is part of most modern programming languages Source 21সোর্স 21. The REST API endpoint (used by the Docker CLI to communicate with the Docker daemon) now uses a Unix socket instead of a TCP socket bound on 127.0.0.1 Source 20সোর্স 20. You can also expose the REST API over HTTP if you explicitly decide to do so Source 20সোর্স 20.
Pulling images. docker pull downloads an image from a registry without running it Source 2সোর্স 2. docker run pulls the image it needs if it isn't on your machine yet Source 2সোর্স 2. If you don't name a registry, Docker uses Docker Hub Source 2সোর্স 2.
This diagram is the tutorial's own summary of the sentences above about the client, the daemon, and pulling images:
you ── docker run ──> Docker client (docker)
│ REST API
▼
Docker daemon (dockerd) ── pull ──> registry (Docker Hub by default)
│
manages images, containers, networks, volumesWhat docker run does. The docker run command runs a command in a new container, pulling the image if needed and starting the container Source 10সোর্স 10. The list below is what the Docker pages say about it. The order is the tutorial's own:
- With
--pull, the valuemissingis the default: it pulls the image if it was not found in the image cache, or uses the cached image otherwise Source 10সোর্স 10. - When a container starts, it uses the image's layers as they are and adds one thin writable layer of its own on top Source 2সোর্স 2.
- When you start Docker, a default bridge network (also called bridge) is created automatically, and newly-started containers connect to it unless otherwise specified Source 23সোর্স 23.
- A stopped container isn't gone: its configuration and its writable layer are kept Source 22সোর্স 22.
- You can restart a stopped container with all its previous changes intact using
docker startSource 10সোর্স 10.
Images are made of layers. Images are immutable: once built, an image never changes Source 2সোর্স 2. An image isn't one big file; it's an ordered stack of layers, each one a set of filesystem changes: files added, changed, or deleted Source 3সোর্স 3. Each Dockerfile instruction that changes files produces one layer, and once a layer is created, it never changes Source 3সোর্স 3. Docker reuses a layer from an earlier build only when nothing it depends on has changed Source 3সোর্স 3.
The container's own layer. By default, all files created inside a container are stored on a writable container layer that sits on top of the read-only, immutable image layers Source 5সোর্স 5. Data written to the container layer doesn't persist when the container is destroyed Source 5সোর্স 5. Docker in Practice shows how volumes keep data.
Isolation. When you start a container with docker run, behind the scenes Docker creates a set of namespaces and control groups for the container Source 20সোর্স 20. Namespaces provide the first and most straightforward form of isolation Source 20সোর্স 20. Processes running within a container cannot see, and even less affect, processes running in another container, or in the host system Source 20সোর্স 20.
Ports. All ports of containers on bridge networks are accessible from the Docker host and other containers connected to the same network Source 6সোর্স 6. They are not accessible from outside the host Source 6সোর্স 6. The --publish or -p flag makes a port available outside the host: -p 8080:80 maps port 8080 on the Docker host to TCP port 80 in the container Source 6সোর্স 6.
সহজ English
Client and daemon. Docker Engine works as a client and a server Source 1সোর্স 1. The server is a long-running process, the Docker daemon (dockerd) Source 1সোর্স 1. It also has APIs, the interfaces that programs can use to talk to the Docker daemon and to instruct it Source 1সোর্স 1. The client is a command line tool, docker Source 1সোর্স 1. It uses the Docker APIs to control the Docker daemon or to interact with it, through scripts or direct commands Source 1সোর্স 1. The daemon creates and manages Docker objects, such as images, containers, networks, and volumes Source 1সোর্স 1. The Docker Engine API is a RESTful API accessed by an HTTP client such as wget or curl, or by the HTTP library of most modern programming languages Source 21সোর্স 21. The REST API endpoint that the Docker CLI uses to talk to the Docker daemon now uses a Unix socket, not a TCP socket bound on 127.0.0.1 Source 20সোর্স 20. You can also expose the REST API over HTTP if you explicitly decide to do so Source 20সোর্স 20.
Pulling images. docker pull downloads an image from a registry without running it Source 2সোর্স 2. docker run pulls the image that it needs if the image is not on your machine yet Source 2সোর্স 2. If you don't name a registry, Docker uses Docker Hub Source 2সোর্স 2.
This diagram is the tutorial's own summary of the sentences above about the client, the daemon, and pulling images:
you ── docker run ──> Docker client (docker)
│ REST API
▼
Docker daemon (dockerd) ── pull ──> registry (Docker Hub by default)
│
manages images, containers, networks, volumesWhat docker run does. The docker run command runs a command in a new container, pulling the image if needed and starting the container Source 10সোর্স 10. The list below is what the Docker pages say about it. The order is the tutorial's own:
- With
--pull, the valuemissingis the default: Docker pulls the image if it was not found in the image cache, or uses the cached image otherwise Source 10সোর্স 10. - When a container starts, it uses the layers of the image as they are, and it adds one thin writable layer of its own on top Source 2সোর্স 2.
- When you start Docker, it creates a default bridge network (also called bridge) automatically, and newly-started containers connect to it unless you say otherwise Source 23সোর্স 23.
- A stopped container is not gone: its configuration and its writable layer are kept Source 22সোর্স 22.
- You can restart a stopped container with all its previous changes intact, using
docker startSource 10সোর্স 10.
Images are made of layers. Images are immutable: once an image is built, it never changes Source 2সোর্স 2. An image is not one big file. It is an ordered stack of layers, and each layer is a set of file changes: files added, changed, or deleted Source 3সোর্স 3. Each Dockerfile instruction that changes files makes one layer, and once a layer is made, it never changes Source 3সোর্স 3. Docker uses a layer from an earlier build again only when nothing that the layer depends on has changed Source 3সোর্স 3.
The container's own layer. By default, the files that a container creates go into a writable layer, on top of the read-only layers of the image Source 5সোর্স 5. When the container is destroyed, the data in that layer is gone Source 5সোর্স 5. Docker in Practice shows how volumes keep data.
Isolation. When you start a container with docker run, Docker creates a set of namespaces and control groups for the container behind the scenes Source 20সোর্স 20. Namespaces provide the first and most straightforward form of isolation Source 20সোর্স 20. Processes running within a container cannot see, and even less affect, processes running in another container or in the host system Source 20সোর্স 20.
Ports. The Docker host and other containers on the same network can reach all ports of a container on a bridge network Source 6সোর্স 6. Nothing outside the host can reach them Source 6সোর্স 6. The --publish or -p flag opens a port to the outside: -p 8080:80 connects port 8080 on the Docker host to TCP port 80 in the container Source 6সোর্স 6.
বাংলা ব্যাখ্যা
Client আর daemon। Docker Engine একটা client-server application হিসেবে কাজ করে Source 1সোর্স 1। এর একটা server আছে, যেটা একটা দীর্ঘক্ষণ চলা daemon process, dockerd Source 1সোর্স 1। এর API আছে, যেগুলো এমন interface ঠিক করে, যা দিয়ে program-গুলো Docker daemon-এর সাথে কথা বলতে ও তাকে নির্দেশ দিতে পারে Source 1সোর্স 1। এর একটা command line interface (CLI) client আছে, docker Source 1সোর্স 1। CLI scripting বা সরাসরি CLI command দিয়ে Docker daemon-কে নিয়ন্ত্রণ করতে বা তার সাথে কাজ করতে Docker API ব্যবহার করে Source 1সোর্স 1। daemon image, container, network ও volume-এর মতো Docker object তৈরি ও পরিচালনা করে Source 1সোর্স 1। Docker Engine API একটা RESTful API, যা wget বা curl-এর মতো একটা HTTP client দিয়ে, অথবা বেশির ভাগ আধুনিক programming language-এর HTTP library দিয়ে access করা হয় Source 21সোর্স 21। Docker CLI যে REST API endpoint দিয়ে Docker daemon-এর সাথে যোগাযোগ করে, সেটা এখন 127.0.0.1-এ bind করা TCP socket-এর বদলে একটা Unix socket ব্যবহার করে Source 20সোর্স 20। আপনি স্পষ্টভাবে সিদ্ধান্ত নিলে REST API HTTP-র ওপরেও খুলে দিতে পারেন Source 20সোর্স 20।
Image pull করা। docker pull image না চালিয়েই একটা registry থেকে সেটা download করে Source 2সোর্স 2। docker run যে image দরকার, সেটা আপনার machine-এ এখনও না থাকলে pull করে Source 2সোর্স 2। আপনি কোনো registry-র নাম না দিলে Docker, Docker Hub ব্যবহার করে Source 2সোর্স 2।
এই diagram client, daemon আর image pull করা নিয়ে ওপরের বাক্যগুলোর টিউটোরিয়ালের নিজের সারাংশ:
you ── docker run ──> Docker client (docker)
│ REST API
▼
Docker daemon (dockerd) ── pull ──> registry (Docker Hub by default)
│
manages images, containers, networks, volumesdocker run কী করে। docker run command একটা নতুন container-এ একটা command চালায়, দরকার হলে image pull করে এবং container চালু করে Source 10সোর্স 10। নিচের তালিকা Docker-এর page এ-বিষয়ে যা বলে তা-ই। ক্রমটা টিউটোরিয়ালের নিজের:
--pull-এর মানmissingহলো default: image, image cache-এ না পাওয়া গেলে Docker সেটা pull করে, নইলে cache-এ থাকা image ব্যবহার করে Source 10সোর্স 10।- একটা container চালু হলে সেটা image-এর layer যেমন আছে তেমনই ব্যবহার করে, আর নিজের একটা পাতলা writable layer ওপরে যোগ করে Source 2সোর্স 2।
- আপনি Docker চালু করলে একটা default bridge network (যাকে bridge-ও বলে) নিজে থেকেই তৈরি হয়, আর নতুন চালু হওয়া container অন্য কিছু ঠিক করা না থাকলে সেটায় যুক্ত হয় Source 23সোর্স 23।
- থেমে যাওয়া একটা container হারিয়ে যায় না: তার configuration আর তার writable layer রাখা থাকে Source 22সোর্স 22।
docker startদিয়ে আপনি থেমে যাওয়া একটা container তার আগের সব পরিবর্তন অক্ষত রেখে আবার চালু করতে পারেন Source 10সোর্স 10।
Image layer দিয়ে তৈরি। image immutable: একবার তৈরি হলে আর কখনো বদলায় না Source 2সোর্স 2। image একটা বড় file নয়; সেটা layer-এর একটা ক্রমবদ্ধ স্তূপ, যার প্রতিটা layer file system-এর একসেট পরিবর্তন: file যোগ, বদল বা মোছা Source 3সোর্স 3। file বদলায় এমন প্রতিটা Dockerfile instruction একটা করে layer তৈরি করে, আর একটা layer তৈরি হওয়ার পর সেটা আর কখনো বদলায় না Source 3সোর্স 3। আগের build-এর একটা layer Docker শুধু তখনই আবার ব্যবহার করে, যখন সেটা যার ওপর নির্ভর করে তার কিছুই বদলায়নি Source 3সোর্স 3।
Container-এর নিজের layer। default-ভাবে container-এর ভেতরে তৈরি সব file একটা writable container layer-এ থাকে, যেটা image-এর read-only, immutable layer-গুলোর ওপরে বসে Source 5সোর্স 5। container ধ্বংস হলে container layer-এ লেখা data থাকে না Source 5সোর্স 5। volume কীভাবে data রাখে, তা Docker in Practice পেজে আছে।
আলাদা রাখা (isolation)। আপনি docker run দিয়ে একটা container চালু করলে Docker পর্দার আড়ালে container-এর জন্য namespace আর control group-এর একটা সেট তৈরি করে Source 20সোর্স 20। namespace হলো isolation-এর প্রথম ও সবচেয়ে সরাসরি রূপ Source 20সোর্স 20। একটা container-এর ভেতরে চলা process অন্য container বা host system-এর process দেখতেই পারে না, প্রভাব ফেলা তো দূরের কথা Source 20সোর্স 20।
Port। bridge network-এ থাকা container-এর সব port Docker host আর একই network-এ যুক্ত অন্য container থেকে পাওয়া যায় Source 6সোর্স 6। host-এর বাইরে থেকে এগুলো পাওয়া যায় না Source 6সোর্স 6। --publish বা -p flag একটা port host-এর বাইরে খুলে দেয়: -p 8080:80 Docker host-এর port 8080-কে container-এর TCP port 80-এর সাথে map করে Source 6সোর্স 6।
Try it
This practice run needs only Docker. Docker Desktop includes Docker Engine, the Docker CLI, Buildx, and Compose Source 7সোর্স 7. On Ubuntu, you can also install Docker Engine Source 8সোর্স 8. The tutorial ran these steps on 2026-11-16 with Docker Engine 29.9.3 on Linux. Your IDs, sizes, and times will differ.
1. Check the install. Run the hello-world image Source 8সোর্স 8. The command downloads a test image and runs it in a container; the container prints a confirmation message and exits Source 8সোর্স 8. After you install Docker Engine on Ubuntu, the docker group exists but contains no users, so you need sudo to run Docker commands until you follow the post-installation steps for Linux Source 8সোর্স 8.
docker run hello-worldThe start of the output, from the tutorial's run:
Hello from Docker!
This message shows that your installation appears to be working correctly.2. Pull an image and look at its layers. docker pull downloads an image from a registry Source 9সোর্স 9. If no tag is provided, Docker Engine uses the :latest tag as a default Source 9সোর্স 9. docker image ls lists the images on your machine Source 22সোর্স 22, and docker image history lists an image's layers, newest first Source 3সোর্স 3:
docker pull docker/welcome-to-docker
docker image ls
docker image history docker/welcome-to-dockerDocker prints the digest of the image after the pull has finished Source 9সোর্স 9. In the tutorial's run, the newest layer of the history copied /app/build to /usr/share/nginx/html:
IMAGE CREATED CREATED BY SIZE
c4d56c24da4f 15 months ago COPY /app/build /usr/share/nginx/html # buil… 1.65MB3. Run it. -d runs the container in the background and prints the container ID Source 10সোর্স 10. --name assigns a name to the container Source 10সোর্স 10. With the localhost IP address in the publish flag, only the Docker host can access the published port Source 6সোর্স 6:
docker run -d -p 127.0.0.1:8080:80 --name welcome docker/welcome-to-dockerThen visit http://localhost:8080 in your browser.
4. Look inside. docker ps shows only running containers Source 22সোর্স 22. docker logs fetches the logs of a container Source 12সোর্স 12. docker exec executes a command in a running container Source 13সোর্স 13:
docker ps
docker logs welcome
docker exec welcome ls /usr/share/nginx/htmlFrom the tutorial's run, docker ps showed the port mapping, and ls listed these files:
CONTAINER ID IMAGE ... STATUS PORTS NAMES
a35d70cab22a docker/welcome-to-docker ... Up 2 seconds 127.0.0.1:8080->80/tcp welcome
50x.html
asset-manifest.json
favicon.ico
index.html
robots.txt
static5. Stop and remove it. docker stop stops one or more running containers Source 14সোর্স 14. By default, docker ps shows just running containers; -a shows all containers Source 11সোর্স 11. docker rm removes one or more containers Source 15সোর্স 15, and it deletes the container and its writable layer Source 22সোর্স 22.
docker stop welcome
docker ps -a
docker rm welcome6. Leave nothing behind. --rm automatically removes the container and its associated anonymous volumes when it exits Source 10সোর্স 10:
docker run --rm hello-worldসহজ English
This practice run needs only Docker. Docker Desktop includes Docker Engine, the Docker CLI, Buildx, and Compose Source 7সোর্স 7. On Ubuntu, you can also install Docker Engine Source 8সোর্স 8. The tutorial ran these steps on 2026-11-16 with Docker Engine 29.9.3 on Linux. Your IDs, sizes, and times will be different.
1. Check the install. Run the hello-world image Source 8সোর্স 8. It downloads a test image and runs it in a container. The container prints a message that all is well, and stops Source 8সোর্স 8. Right after you install Docker Engine on Ubuntu, the docker group has no users, so you need sudo for Docker commands until you do the post-installation steps for Linux Source 8সোর্স 8.
docker run hello-worldThe start of the output, from the tutorial's run:
Hello from Docker!
This message shows that your installation appears to be working correctly.2. Get an image and look at its layers. docker pull downloads an image from a registry Source 9সোর্স 9. If you give no tag, Docker uses the tag :latest Source 9সোর্স 9. docker image ls lists the images on your machine Source 22সোর্স 22, and docker image history lists the layers of an image, newest first Source 3সোর্স 3:
docker pull docker/welcome-to-docker
docker image ls
docker image history docker/welcome-to-dockerDocker prints the digest of the image when the pull is done Source 9সোর্স 9. In the tutorial's run, the newest layer copied /app/build to /usr/share/nginx/html:
IMAGE CREATED CREATED BY SIZE
c4d56c24da4f 15 months ago COPY /app/build /usr/share/nginx/html # buil… 1.65MB3. Run it. -d runs the container in the background and prints its ID Source 10সোর্স 10. --name gives the container a name Source 10সোর্স 10. When the publish flag has the localhost address, only the Docker host can reach the port Source 6সোর্স 6:
docker run -d -p 127.0.0.1:8080:80 --name welcome docker/welcome-to-dockerThen open http://localhost:8080 in your browser.
4. Look inside. docker ps shows only the running containers Source 22সোর্স 22. docker logs gets the logs of a container Source 12সোর্স 12. docker exec runs a command inside a running container Source 13সোর্স 13:
docker ps
docker logs welcome
docker exec welcome ls /usr/share/nginx/htmlIn the tutorial's run, docker ps showed the port mapping, and ls listed these files:
CONTAINER ID IMAGE ... STATUS PORTS NAMES
a35d70cab22a docker/welcome-to-docker ... Up 2 seconds 127.0.0.1:8080->80/tcp welcome
50x.html
asset-manifest.json
favicon.ico
index.html
robots.txt
static5. Stop and remove it. docker stop stops running containers Source 14সোর্স 14. By default, docker ps shows only the running ones; -a shows all containers Source 11সোর্স 11. docker rm removes containers Source 15সোর্স 15, and it deletes the container and its writable layer Source 22সোর্স 22.
docker stop welcome
docker ps -a
docker rm welcome6. Leave nothing behind. --rm removes the container, and its anonymous volumes, by itself when it stops Source 10সোর্স 10:
docker run --rm hello-worldবাংলা ব্যাখ্যা
এই practice run-এ শুধু Docker লাগে। Docker Desktop-এ Docker Engine, Docker CLI, Buildx আর Compose আছে Source 7সোর্স 7। Ubuntu-তে আপনি Docker Engine-ও install করতে পারেন Source 8সোর্স 8। টিউটোরিয়াল এই ধাপগুলো 2026-11-16 তারিখে Linux-এ Docker Engine 29.9.3 দিয়ে চালিয়েছে। আপনার ID, size আর সময় আলাদা হবে।
১. install ঠিক আছে কি না দেখুন। hello-world image চালান Source 8সোর্স 8। command-টা একটা test image download করে একটা container-এ চালায়; container একটা নিশ্চিতকরণ message print করে বেরিয়ে যায় Source 8সোর্স 8। Ubuntu-তে Docker Engine install-এর পর docker group থাকে, কিন্তু তাতে কোনো user থাকে না, তাই Linux-এর post-installation ধাপগুলো না করা পর্যন্ত Docker command চালাতে আপনার sudo লাগবে Source 8সোর্স 8।
docker run hello-worldটিউটোরিয়ালের run থেকে output-এর শুরুটা:
Hello from Docker!
This message shows that your installation appears to be working correctly.২. একটা image pull করে তার layer দেখুন। docker pull একটা registry থেকে image download করে Source 9সোর্স 9। কোনো tag না দিলে Docker Engine default হিসেবে :latest tag ব্যবহার করে Source 9সোর্স 9। docker image ls আপনার machine-এর image-গুলোর তালিকা দেখায় Source 22সোর্স 22, আর docker image history একটা image-এর layer-গুলো দেখায়, সবচেয়ে নতুনটা আগে Source 3সোর্স 3:
docker pull docker/welcome-to-docker
docker image ls
docker image history docker/welcome-to-dockerpull শেষ হলে Docker image-এর digest print করে Source 9সোর্স 9। টিউটোরিয়ালের run-এ history-র সবচেয়ে নতুন layer /app/build থেকে /usr/share/nginx/html-এ copy করেছে:
IMAGE CREATED CREATED BY SIZE
c4d56c24da4f 15 months ago COPY /app/build /usr/share/nginx/html # buil… 1.65MB৩. চালান। -d container-টা background-এ চালায় আর container ID print করে Source 10সোর্স 10। --name container-কে একটা নাম দেয় Source 10সোর্স 10। publish flag-এ localhost IP address দিলে শুধু Docker host-ই publish করা port-এ পৌঁছাতে পারে Source 6সোর্স 6:
docker run -d -p 127.0.0.1:8080:80 --name welcome docker/welcome-to-dockerতারপর browser-এ http://localhost:8080 খুলুন।
৪. ভেতরে দেখুন। docker ps শুধু চলমান container দেখায় Source 22সোর্স 22। docker logs একটা container-এর log আনে Source 12সোর্স 12। docker exec একটা চলমান container-এর ভেতরে একটা command চালায় Source 13সোর্স 13:
docker ps
docker logs welcome
docker exec welcome ls /usr/share/nginx/htmlটিউটোরিয়ালের run-এ docker ps port mapping দেখিয়েছে, আর ls এই file-গুলোর তালিকা দিয়েছে:
CONTAINER ID IMAGE ... STATUS PORTS NAMES
a35d70cab22a docker/welcome-to-docker ... Up 2 seconds 127.0.0.1:8080->80/tcp welcome
50x.html
asset-manifest.json
favicon.ico
index.html
robots.txt
static৫. থামিয়ে মুছে ফেলুন। docker stop এক বা একাধিক চলমান container থামায় Source 14সোর্স 14। default-ভাবে docker ps শুধু চলমান container দেখায়; -a সব container দেখায় Source 11সোর্স 11। docker rm এক বা একাধিক container মুছে দেয় Source 15সোর্স 15, আর container-টা ও তার writable layer মুছে ফেলে Source 22সোর্স 22।
docker stop welcome
docker ps -a
docker rm welcome৬. কিছু রেখে যাবেন না। --rm দিলে container বেরিয়ে যাওয়ার সময় container আর তার সাথে যুক্ত anonymous volume নিজে থেকেই মুছে যায় Source 10সোর্স 10:
docker run --rm hello-worldHow a tester uses it
Start the dependencies of a test. Testcontainers is an open source library for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container Source 18সোর্স 18. You define your test dependencies as code; when you run your tests, containers are created and then deleted Source 18সোর্স 18. The project says that your tests will always start with a known state Source 18সোর্স 18.
Run browser tests in a container. Playwright publishes a Docker image that includes the Playwright browsers and browser system dependencies Source 19সোর্স 19. The Playwright package is not included in the image and should be installed separately Source 19সোর্স 19. The image is intended to be used for testing and development purposes only Source 19সোর্স 19. For end-to-end tests on trusted websites, Playwright's example starts a shell in the image Source 19সোর্স 19:
docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.64.1-noble /bin/bashUsing --ipc=host is recommended when using Chromium Source 19সোর্স 19. CI/CD Pipelines shows a pipeline that runs Playwright tests.
Know which image you tested. docker pull ubuntu:24.04 pulls the latest version of the Ubuntu 24.04 image Source 9সোর্স 9. When you pull an image by digest, you specify exactly which version of an image to pull Source 9সোর্স 9. That lets you pin an image to that version and guarantee that the image you're using is always the same Source 9সোর্স 9. docker image ls --digests shows the digests of your images Source 16সোর্স 16.
Collect evidence for a bug report. docker logs --timestamps adds an RFC3339Nano timestamp to each log entry Source 12সোর্স 12. The --since option shows only the container logs generated after a given date, or a relative time such as 42m for 42 minutes Source 12সোর্স 12. docker inspect returns low-level information on Docker objects, and by default it renders the results in a JSON array Source 17সোর্স 17.
Throw a test environment away. Data written to the container layer doesn't persist when the container is destroyed Source 5সোর্স 5. Each run of docker run --rm starts a new container from the image, and the container is removed when it exits Source 10সোর্স 10.
সহজ English
Start what a test needs. Testcontainers is an open source library. It gives you short-lived, lightweight databases, message brokers, web browsers, or almost anything else that can run in a Docker container Source 18সোর্স 18. You describe what your tests need in code. When you run the tests, the containers are made, and then deleted Source 18সোর্স 18. The project says that your tests will always start from a known state Source 18সোর্স 18.
Run browser tests in a container. Playwright publishes a Docker image with the Playwright browsers and the system parts that the browsers need Source 19সোর্স 19. The Playwright package itself is not in the image, and you should install it separately Source 19সোর্স 19. The image is meant only for testing and development Source 19সোর্স 19. For end-to-end tests on websites that you trust, Playwright's example opens a shell in the image Source 19সোর্স 19:
docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.64.1-noble /bin/bashPlaywright recommends --ipc=host when you use Chromium Source 19সোর্স 19. CI/CD Pipelines shows a pipeline that runs Playwright tests.
Know which image you tested. docker pull ubuntu:24.04 gets the latest version of the Ubuntu 24.04 image Source 9সোর্স 9. When you pull an image by its digest, you say exactly which version you want Source 9সোর্স 9. That pins the image, so the image that you use is always the same one Source 9সোর্স 9. docker image ls --digests shows the digests of your images Source 16সোর্স 16.
Collect evidence for a bug report. docker logs --timestamps puts a timestamp (RFC3339Nano) on each log line Source 12সোর্স 12. --since shows only the logs after a given time, or a time span such as 42m for 42 minutes Source 12সোর্স 12. docker inspect returns low-level information about Docker objects, as a JSON array by default Source 17সোর্স 17.
Throw a test environment away. When the container is destroyed, the data in its own layer is gone Source 5সোর্স 5. Each docker run --rm starts a new container from the image, and removes the container when it stops Source 10সোর্স 10.
বাংলা ব্যাখ্যা
test-এর dependency চালু করুন। Testcontainers একটা open source library, যা database, message broker, web browser, বা Docker container-এ চলতে পারে এমন প্রায় যেকোনো কিছুর ফেলে দেওয়ার মতো, হালকা instance দেয় Source 18সোর্স 18। আপনি test-এর dependency code হিসেবে লেখেন; test চালালে container তৈরি হয়, তারপর মুছে যায় Source 18সোর্স 18। project-টা বলে, আপনার test সবসময় একটা জানা state থেকে শুরু হবে Source 18সোর্স 18।
browser test একটা container-এ চালান। Playwright একটা Docker image publish করে, যাতে Playwright browser আর browser-এর system dependency আছে Source 19সোর্স 19। Playwright package image-এ থাকে না, এটা আলাদা করে install করা উচিত Source 19সোর্স 19। image-টা শুধু testing আর development-এর জন্য বানানো Source 19সোর্স 19। বিশ্বস্ত website-এ end-to-end test-এর জন্য Playwright-এর উদাহরণ image-এর ভেতরে একটা shell চালু করে Source 19সোর্স 19:
docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.64.1-noble /bin/bashChromium ব্যবহার করলে --ipc=host দেওয়ার পরামর্শ দেওয়া হয় Source 19সোর্স 19। Playwright test চালানো একটা pipeline CI/CD Pipelines পেজে আছে।
কোন image test করেছেন, জানুন। docker pull ubuntu:24.04 Ubuntu 24.04 image-এর সর্বশেষ version pull করে Source 9সোর্স 9। digest দিয়ে image pull করলে আপনি ঠিক কোন version চান, সেটা নির্দিষ্ট করেন Source 9সোর্স 9। এতে image সেই version-এ pin হয়, আর নিশ্চিত হয় যে আপনি সবসময় একই image ব্যবহার করছেন Source 9সোর্স 9। docker image ls --digests আপনার image-গুলোর digest দেখায় Source 16সোর্স 16।
bug report-এর প্রমাণ জোগাড় করুন। docker logs --timestamps প্রতিটা log entry-তে একটা RFC3339Nano timestamp যোগ করে Source 12সোর্স 12। --since option শুধু একটা নির্দিষ্ট সময়ের পরে তৈরি log দেখায়, অথবা 42m-এর মতো আপেক্ষিক সময় (42 মিনিট) Source 12সোর্স 12। docker inspect Docker object-এর low-level তথ্য দেয়, আর default-ভাবে ফল একটা JSON array-তে দেখায় Source 17সোর্স 17।
test environment ফেলে দিন। container ধ্বংস হলে container layer-এ লেখা data থাকে না Source 5সোর্স 5। প্রতিবার docker run --rm image থেকে একটা নতুন container শুরু করে, আর container বেরিয়ে গেলে সেটা মুছে যায় Source 10সোর্স 10।
Common mistakes
- Keeping test data in the container. Data written to the container layer doesn't persist when the container is destroyed Source 5সোর্স 5. Keep data that must survive in a volume (Docker in Practice).
- Publishing a port to everyone. Publishing container ports is insecure by default: a published port becomes available not only to the Docker host, but to the outside world as well Source 6সোর্স 6. Include
127.0.0.1in the publish flag, so that only the Docker host can access the port Source 6সোর্স 6. - Relying on a tag alone. If no tag is provided, Docker Engine uses the
:latesttag as a default Source 9সোর্স 9, andubuntu:24.04pulls the latest version of the Ubuntu 24.04 image Source 9সোর্স 9. Pull by digest when you need the same image every time Source 9সোর্স 9. - A Playwright image that does not match the project. If the Playwright version in your Docker image does not match the version in your project or tests, Playwright will be unable to locate browser executables Source 19সোর্স 19.
- Looking for a stopped container with
docker ps.docker psshows only running containers;docker ps -ashows all of them Source 22সোর্স 22. - Expecting a slow shutdown to finish. If the container does not exit after the timeout elapses, it's forcibly killed with a
SIGKILLsignal Source 14সোর্স 14.--timeoutsets the number of seconds to wait Source 14সোর্স 14.
সহজ English
- Keeping test data in the container. When the container is destroyed, the data in its own layer is gone Source 5সোর্স 5. Keep data that must stay in a volume (Docker in Practice).
- Opening a port to everyone. Publishing a port is not safe by default: the port is open not only to the Docker host, but to the outside world too Source 6সোর্স 6. Put
127.0.0.1in the publish flag, so that only the Docker host can reach the port Source 6সোর্স 6. - Relying on a tag alone. If you give no tag, Docker uses
:latestSource 9সোর্স 9, andubuntu:24.04gets the latest version of the Ubuntu 24.04 image Source 9সোর্স 9. Pull by digest when you need the same image every time Source 9সোর্স 9. - A Playwright image that does not match the project. If the Playwright version in the image is not the version in your project, Playwright cannot find the browsers Source 19সোর্স 19.
- Looking for a stopped container with
docker ps.docker psshows only running containers;docker ps -ashows all of them Source 22সোর্স 22. - Expecting a slow shutdown to finish. If the container has not stopped when the wait time is over, Docker kills it with a
SIGKILLsignal Source 14সোর্স 14.--timeoutsets how many seconds to wait Source 14সোর্স 14.
বাংলা ব্যাখ্যা
- container-এ test data রাখা। container ধ্বংস হলে container layer-এ লেখা data থাকে না Source 5সোর্স 5। যে data থাকতে হবে, তা একটা volume-এ রাখুন (Docker in Practice)।
- সবার জন্য port publish করা। container port publish করা default-ভাবে অনিরাপদ: publish করা port শুধু Docker host-এর জন্য নয়, বাইরের দুনিয়ার জন্যও খুলে যায় Source 6সোর্স 6। publish flag-এ
127.0.0.1দিন, যাতে শুধু Docker host-ই port-এ পৌঁছাতে পারে Source 6সোর্স 6। - শুধু tag-এর ওপর ভরসা করা। কোনো tag না দিলে Docker Engine default হিসেবে
:latesttag ব্যবহার করে Source 9সোর্স 9, আরubuntu:24.04Ubuntu 24.04 image-এর সর্বশেষ version pull করে Source 9সোর্স 9। প্রতিবার একই image দরকার হলে digest দিয়ে pull করুন Source 9সোর্স 9। - project-এর সাথে না মেলা Playwright image। Docker image-এর Playwright version আপনার project বা test-এর version-এর সাথে না মিললে Playwright browser executable খুঁজে পাবে না Source 19সোর্স 19।
docker psদিয়ে থেমে যাওয়া container খোঁজা।docker psশুধু চলমান container দেখায়;docker ps -aসবগুলো দেখায় Source 22সোর্স 22।- ধীর shutdown শেষ হবে ভাবা। timeout শেষ হওয়ার পরও container বেরিয়ে না গেলে
SIGKILLsignal দিয়ে জোর করে বন্ধ করা হয় Source 14সোর্স 14।--timeoutকত সেকেন্ড অপেক্ষা করবে, তা ঠিক করে Source 14সোর্স 14।
What a tester can check
Tutorial advice
This list is the tutorial's own advice for a tester on a team that uses Docker.
- Ask which image, tag, and digest each test environment runs, and put them in your bug reports.
- Ask whether the databases and services that your tests need run in containers with fixed versions.
- On a shared machine, publish test ports to
127.0.0.1only. - Use
--rmfor throwaway runs, so that stopped containers do not pile up. - Save
docker logs --timestampsfor the time window of a failure. - Keep the version of the Playwright image equal to the Playwright version of the project.
সহজ English
Tutorial advice
This list is the tutorial's own advice for a tester on a team that uses Docker.
- Ask which image, tag, and digest each test environment runs, and put them in your bug reports.
- Ask if the databases and services that your tests need run in containers with fixed versions.
- On a shared machine, open test ports to
127.0.0.1only. - Use
--rmfor throwaway runs, so that stopped containers do not pile up. - Save
docker logs --timestampsfor the time when a test failed. - Keep the version of the Playwright image the same as the Playwright version of the project.
বাংলা ব্যাখ্যা
Tutorial advice
এই তালিকা টিউটোরিয়ালের নিজের পরামর্শ, Docker ব্যবহার করা টিমের একজন tester-এর জন্য।
- জিজ্ঞেস করুন প্রতিটা test environment কোন image, tag আর digest চালায়, আর সেগুলো bug report-এ লিখুন।
- জিজ্ঞেস করুন আপনার test-এর দরকারি database আর service নির্দিষ্ট version-সহ container-এ চলে কি না।
- shared machine-এ test port শুধু
127.0.0.1-এ publish করুন। - ফেলে দেওয়ার মতো run-এ
--rmব্যবহার করুন, যাতে থেমে যাওয়া container জমে না থাকে। - একটা failure-এর সময়ের
docker logs --timestampsসংরক্ষণ করুন। - Playwright image-এর version project-এর Playwright version-এর সমান রাখুন।
Key words
| Term | Meaning |
|---|---|
| Docker Engine | An open source containerization technology for building and containerizing your applications |
| Container | An ordinary process on your computer, such as a Node.js server, that runs in isolation; its files come from an image |
| Image | A package of everything a container needs to start; the operating system files, the language runtime, the app's dependencies and code, and settings such as which command to run |
| Layer | A set of filesystem changes; files added, changed, or deleted; an image is an ordered stack of layers |
| Writable container layer | Where the files created inside a container are stored; its data doesn't persist when the container is destroyed |
| Registry | A service that stores images so anyone with access can pull them |
| Docker Hub | Docker's public registry and the default one |
Docker daemon (dockerd) | A server with a long-running daemon process; the daemon creates and manages Docker objects, such as images, containers, networks, and volumes |
Docker client (docker) | A command line interface (CLI) client; the CLI uses Docker APIs to control or interact with the Docker daemon |
Tag (:latest) | :latest is the tag that Docker Engine uses as a default when no tag is provided |
| Digest | Pulling by digest specifies exactly which version of an image to pull |
Publish (-p) | Makes a container port available outside the host, as in -p 8080:80 |
| Namespaces | Docker creates a set of namespaces and control groups for the container; namespaces provide the first and most straightforward form of isolation |