top of page

Welcome
to NumpyNinja Blogs

NumpyNinja: Blogs. Demystifying Tech,

One Blog at a Time.
Millions of views. 

Docker for Curious Minds - Your first step, Part 1

Updated: Aug 28


ree

What is Docker?

-----

Docker is an open-source tool that allows you to pack the code, dependencies, and environment of your application into isolated containers. Each container is created from an image, which you can build yourself or pull from Docker Hub. These containers are lightweight, portable, and can run the same way in any system.


Why Docker was created: problems with traditional deployment methods

------

Traditional deployment Method problems


1) Manual setup, dependencies installed system-wide, risk of conflicts

2) Every library and tool is installed in the system, so this creates clutter in the machine and causes version conflicts, making cleanup complicated

3) Traditional deployments can break when moving from one environment to another, due to OS differences, configuration mismatches, or missing dependencies.

4) It uses Virtual machines, which are heavy, slow, and hard to manage.


How did traditional application setups work before Docker?


ree

  1. Developer writes the code - Creates an automation framework using Selenium, Java,..etc.

  2. Manual Environment setup - Each Tester or developer manually installs JDK, Maven, browsers, etc

  3. Code Sharing - Code is shared via Git/Zip files, but everyone needs to configure the environment manually.

  4. Environment issues - "Works on my machine" problems occur due to different OS versions and dependencies.

  5. Inconsistent Test results - Running tests is inconsistent across machines due to manual setup differences.


Docker revolutionized over traditional methods.


1) Runs consistently in different environments(dev to production) by having its isolated container of its own libraries, tools, and runtime dependencies on top of host systems.

2) Setup time is fast and automated.

3) It uses Containers, which are lightweight, portable, and easy to manage.

4) Scalability is easy with the Docker compose command.


How does Docker work?



ree

  1. Developer Creates Code - A developer creates the application code and creates a Dockerfile.

  2. Docker Image Build - Using the Dockerfile, a Docker image is built, which packages the code, dependencies, and environment.

  3. Push to Docker Hub - The built Docker image is stored in a Docker registry, such as Docker Hub, for sharing and reuse.

  4. Pull Image to Local/Server - From Docker Hub, the image is pulled to the testers' or production environment.

  5. Run Docker Container - Finally, the pulled image is run as a container, providing a consistent environment for testing or deployment.


Top benefits of using Docker for QA and Test Automation

------

As a QA engineer or an automation tester, you're constantly fighting environment issues, configuration mismatches, and dependency chaos. Docker simplifies all that.


Here’s why Docker is a game-changer for QA and test automation teams:


1) Environment consistency across all stages by using containers from Docker.

2) Faster setup of containers and Teardown at the end of the execution.

3) Efficient Cross-browser and cross-OS testing using Selenium grid with Docker to run tests in parallel across multiple browsers.

4) Easy CI/CD integration by triggering containerized test environments on every code push.

5) Isolated, conflict-free Testing.


Keywords you need to know before starting

-------------

  • Image - Image is a read-only template used to create containers.

It includes the OS, dependencies, and the app itself. An image can be created by us or pulled from Docker Hub.

  • Container - A container is a running instance of an image.

It’s lightweight, isolated, and can be started/stopped quickly.

  • Dockerfile - A text file containing step-by-step instructions to build a custom Docker image.

  • Docker Hub - A public registry where Docker images are stored and shared.

  • Docker Compose - A tool for defining and running multi-container applications using a YAML file(docker-compose.yml)

  • Port Binding - Maps the localhost port with the containers so we can access the Selenium grid or any other web apps from our browser.

  • Network - Defines how containers communicate with each other and the outside world.

  • Tag - A label used to specify the version of a Docker image. The default is: latest

  • Prune - Docker's cleanup command to remove unused containers, volumes, and images.


Important Docker commands

--------

  • docker pull <image> Downloads image from Docker Hub

  • docker push imagename push the image to Docker Hub

  • docker build -t img_name. It builds the image

  • docker run <image> Runs a container from an image

  • docker ps -all Lists running containers

  • docker stop <container_id> Stops a running container

  • docker rm <container_id> Removes a container

  • docker images Lists available images

  • docker rmi <image_id> Removes an image

  • docker start <container_id> Starts a previously stopped container.

  • docker system prune Cleans up unused containers, images, networks, and volumes.

  • docker login logs in to Docker



Prerequisites for using Docker

------

1. Install Docker

Please refer to the following Docker docs link to install the Docker Desktop


Once the Docker installation is done, we can use the "docker version/docker-compose version" command in the command prompt to verify Docker is successfully installed.


2. Create a login on Docker Hub to push or pull images




Found this helpful? 💬 Let me know in the comments! And watch out for Part 2, where we’ll get hands-on with Docker in real scenarios.

Link to Part 2 :


+1 (302) 200-8320

NumPy_Ninja_Logo (1).png

Numpy Ninja Inc. 8 The Grn Ste A Dover, DE 19901

© Copyright 2025 by Numpy Ninja Inc.

  • Twitter
  • LinkedIn
bottom of page