-->

ABOUT US

Our development agency is committed to providing you the best service.

OUR TEAM

The awesome people behind our brand ... and their life motto.

  • Kumar Atul Jaiswal

    Ethical Hacker

    Hacking is a Speed of Innovation And Technology with Romance.

  • Kumar Atul Jaiswal

    CEO Of Hacking Truth

    Loopholes are every major Security,Just need to Understand it well.

  • Kumar Atul Jaiswal

    Web Developer

    Techonology is the best way to Change Everything, like Mindset Goal.

OUR SKILLS

We pride ourselves with strong, flexible and top notch skills.

Marketing

Development 90%
Design 80%
Marketing 70%

Websites

Development 90%
Design 80%
Marketing 70%

PR

Development 90%
Design 80%
Marketing 70%

ACHIEVEMENTS

We help our clients integrate, analyze, and use their data to improve their business.

150

GREAT PROJECTS

300

HAPPY CLIENTS

650

COFFEES DRUNK

1568

FACEBOOK LIKES

STRATEGY & CREATIVITY

Phasellus iaculis dolor nec urna nullam. Vivamus mattis blandit porttitor nullam.

PORTFOLIO

We pride ourselves on bringing a fresh perspective and effective marketing to each project.

  • docker-multi-container-applications-guide


    docker-multi-container-applications-guide

     

    Multi-Container Applications in Docker: A Beginner's Guide



    Modern applications rarely run inside a single container. In real-world production environments, different components of an application are separated into multiple containers. This approach improves scalability, maintainability, security, and performance.

    In this guide, you'll learn what multi-container applications are, why they are important, and how Docker Networks and Docker Volumes help containers communicate and store data efficiently.

     

    What Are Multi-Container Applications?



    A multi-container application consists of multiple Docker containers working together to provide a complete service.

    For example, a typical web application may have:


    • React Frontend
    • Node.js Backend API
    • MongoDB Database



    Instead of running everything inside one container, each service runs in its own container. 

     

    React Frontend
          │
          ▼
    Node.js Backend
          │
          ▼
    MongoDB Database
    
    



    This architecture follows the principle of separation of concerns, making applications easier to manage and scale.

     

     

    Example Multi-Container Architecture



    A typical Docker application may look like this:

    Container 1: Frontend
    Technology: React
    Port: 3000


    Container 2: Backend
    Technology: Node.js
    Port: 5000


    Container 3: Database
    Technology: MongoDB
    Port: 27017

     

     

    Frontend Container (React)
             │
             ▼
    Backend Container (Node.js)
             │
             ▼
    Database Container (MongoDB)
    

     

     
    All containers communicate through a Docker Network.

     


    Why Use Multiple Containers?



    Using separate containers provides several advantages:

    Better Scalability

    You can scale only the service that needs additional resources.


    Example:

    • 1 MongoDB container
    • 3 Backend containers
    • 2 Frontend containers


     

    Easier Maintenance



    If the backend crashes, you can restart only the backend container without affecting the frontend or database.



    Improved Security


    Each service runs in an isolated environment.


    Independent Updates



    Frontend, backend, and database can be updated separately. 

     

    Creating a MongoDB Container



    Start a MongoDB container:

    docker run -d --name mongodb mongo

    Docker downloads the MongoDB image and runs it in the background.

     

    Creating a Custom Docker Network


    Before connecting containers, create a network:

    docker network create mynetwork


    Verify:

    docker network ls

    Docker networks allow containers to communicate using container names instead of IP addresses.

    Starting the Backend Container



    Run the backend container on the custom network:

    • docker run -d --name backend --network mynetwork node




    The backend can now communicate with other containers attached to the same network.


    Starting the Frontend Container

    Run the frontend container:

    • docker run -d --name frontend --network mynetwork react-app




    Now all services are connected through the Docker network.

    Docker Volumes for Persistent Data
    Containers are temporary by nature. If a database container is deleted, its data may be lost.
    Docker Volumes solve this problem.



    Create a Volume

    • docker volume create mydata



    List available volumes:

    • docker volume ls
    • Attach Volume to a Container
    • docker run -v mydata:/app/data nginx


     
    Benefits of Docker Volumes:

    • Persistent storage
    • Data survives container deletion
    • Easy backup and migration
    • Real-World Example: hackingtruth.org


    Imagine hosting hackingtruth.org using Docker.

     

    Application Stack:


    • React Frontend
    • Node.js Backend
    • MongoDB Database

     

    Production Architecture:

     

    Frontend Container
            │
            ▼
    Backend Container
            │
            ▼
    MongoDB Container
    

     



    Supporting Components:



    Docker Network → Container communication
    Docker Volume → Database storage
    Multi-Container Architecture → Service separation


    This setup closely resembles how modern applications are deployed in cloud environments.

     

     

    Essential Commands



    Create Volume
    docker volume create mydata


    List Volumes
    docker volume ls


    Create Network
    docker network create mynetwork


    List Networks
    docker network ls


    Run Container with Volume
    docker run -v mydata:/app/data nginx


    Run Container on a Network
    docker run --network mynetwork nginx


     

    Benefits of Multi-Container Applications


    • Better scalability
    • Easier troubleshooting
    • Improved security
    • Independent deployments
    • Simplified maintenance
    • Production-ready architecture


    These advantages make multi-container applications the preferred approach in modern DevOps and cloud-native environments.



    Conclusion



    Multi-container applications are a fundamental concept in Docker and modern application deployment. By separating frontend, backend, and database services into individual containers, organizations achieve better scalability, reliability, and maintainability.

    Combined with Docker Networks and Docker Volumes, multi-container architecture provides the foundation for deploying professional-grade applications in production environments. Learning these concepts is essential for anyone pursuing a career in DevOps, Cloud Engineering, System Administration, or Software Development.

     

     

  • docker-compose-react-node-deployment-troubleshooting

     

    docker-compose-react-node-deployment-troubleshooting

     

     

     

    Docker Compose, React & Node.js Deployment, and Container Troubleshooting Guide


    As applications grow, managing multiple Docker containers manually becomes difficult. Imagine starting separate containers for React, Node.js, MongoDB, Redis, and Nginx every time you want to run your project.

    Docker Compose solves this problem by allowing you to define and manage multi-container applications using a single configuration file.

    In this guide, you'll learn Docker Compose, deploying React and Node.js applications, and common container troubleshooting techniques.


    What is Docker Compose?


    Docker Compose is a tool that allows you to define and run multiple Docker containers using a single YAML configuration file.

    Instead of running multiple commands manually:

      
    docker run ...
    docker run ...
    docker run ...
    
      



    You can define everything inside a single file:

    docker-compose.yml

    and start all services with one command. 

     

     

    Why Use Docker Compose?



    Benefits include:

    • Simplified container management
    • Easy multi-container deployments
    • Better configuration management
    • Consistent development environments
    • Faster application startup


    Docker Compose is commonly used for:

    • React Applications
    • Node.js APIs
    • MongoDB Databases
    • Redis Caching
    • Nginx Reverse Proxies

     

     

    Understanding docker-compose.yml


    A basic Docker Compose file looks like this:


    In this example:

    frontend runs the React application
    backend runs the Node.js API
    database runs MongoDB

    All services are automatically connected through an internal Docker network.

     

    version: '3'
    
    services:
      frontend:
        image: react-app
    
      backend:
        image: node-app
    
      database:
        image: mongo
    
    

     

     

     In this example:

    • frontend runs the React application
    • backend runs the Node.js API
    • database runs MongoDB


    All services are automatically connected through an internal Docker network. Learn Docker Compose, deploy React and Node.js applications, and master container troubleshooting with practical examples. A beginner-friendly guide for DevOps and System Engineers.

    Starting Docker Compose


    Run:

    • docker compose up


    Docker will:

    • Create networks
    • Create containers
    • Start services
    • Connect containers


    To run in the background:

    • docker compose up -d
    • Stopping Docker Compose


    Stop all services:

    • docker compose down


    Docker removes containers and networks created by Compose.

     

     Deploying a React Application

      
    FROM node:22
    
    WORKDIR /app
    
    COPY package*.json ./
    
    RUN npm install
    
    COPY . .
    
    EXPOSE 3000
    
    CMD ["npm","start"]
      


    Suppose you have a React application.

    Create a Dockerfile:


    Build the image:

    • docker build -t react-app .


    Run the container:

    • docker run -d -p 3000:3000 react-app


    Open:

    • http://localhost:3000


    Your React application should now be accessible.

     

    Deploying a Node.js Application



    Create a Dockerfile:



    Build the image:

      
      FROM node:22
    
    WORKDIR /app
    
    COPY package*.json ./
    
    RUN npm install
    
    COPY . .
    
    EXPOSE 5000
    
    CMD ["node","server.js"]
      

    • docker build -t node-app .


    Run the application:

    • docker run -d -p 5000:5000 node-app


    Access:

    • http://localhost:5000

     

    Deploying React, Node.js, and MongoDB Together



    A production application often contains:



    Docker Compose makes managing these services much easier.

    Example:

     

    React Frontend
           │
           ▼
    Node.js Backend
           │
           ▼
    MongoDB Database
    

     

     
    Start everything:

    docker compose up -d

    Now all services run together.

     

    version: '3'
    
    services:
      frontend:
        image: react-app
        ports:
          - "3000:3000"
    
      backend:
        image: node-app
        ports:
          - "5000:5000"
    
      mongodb:
        image: mongo
        ports:
          - "27017:27017"
    

     

     

    Container Troubleshooting


    Troubleshooting is an essential Docker skill for System Engineers and DevOps Engineers.

    Check Running Container


    • docker ps


    View all containers:

    • docker ps -a 

     

     

    Check Container Logs


    Logs help identify startup issues.

    docker logs container_name

    Example:

    • docker logs backend


    Access Container Shell



    Enter a running container:

    • docker exec -it container_name bash


    Example:

    • docker exec -it backend bash


    This is useful for checking:

    • Application files
    • Environment variables
    • Network connectivity
    • Installed packages

     

     

    Inspect Container Details


    View container configuration:

    docker inspect container_name

    This displays:

    • IP Address
    • Volumes
    • Networks
    • Environment Variables
    • Mount Points
    • Monitor Resource Usage


    Check CPU and Memory:

    • docker stats


    Useful for identifying performance bottlenecks.

     

     Restart a Container


    docker restart container_name

    Example:

    • docker restart backend

     

    Common Docker Issues


    Port Already in Use

    Error:

    • Bind for 0.0.0.0 failed


    Solution:

    • docker ps


    Find the conflicting container and stop it.

     

    Container Exits Immediately



    Check logs:

    • docker logs container_name



    Usually caused by:

    • Incorrect CMD
    • Missing dependencies
    • Application errors
    • Cannot Access Application



    Verify:

    • docker ps



    Check:

    • Port mapping
    • Firewall settings
    • Container status 

     

    Network Communication Issues


    Inspect network:

    • docker network ls
    • Inspect container:
    • docker inspect container_name
    • Ensure containers are connected to the same Docker network.



    Essential Commands


    Start Compose:

    • docker compose up -d
    • Stop Compose:
    • docker compose down
    • View Containers:
    • docker ps
    • View Logs:
    • docker logs container_name
    • Enter Container:
    • docker exec -it container_name bash
    • Inspect Container:
    • docker inspect container_name
    • Monitor Resources:
    • docker stats

     


    Conclusion



    Docker Compose simplifies the management of multi-container applications by allowing developers and system administrators to define services in a single configuration file.

    Combined with React, Node.js, and MongoDB deployments, Docker Compose enables efficient application management and scalable infrastructure. Understanding container troubleshooting techniques further prepares you for real-world DevOps, Cloud Engineering, and System Administration roles.

    Mastering Docker Compose and troubleshooting skills is a significant step toward becoming a proficient System Engineer or DevOps Engineer.

     

     

  • Docker Networking via bridge

     

     

    Docker Networking via bridge

     

    Docker Networking 



    Docker networks allow containers to communicate with each other.

    Example :

     

    Frontend Container
            │
            ▼
    Backend Container
            │
            ▼
    Database Container
      




    Without networking:

    ❌ Containers cannot easily communicate.

    With networking:

    ✅ Containers communicate securely.



    In docker networks there are 6 types of networks - 

    1) bridge
    2) host
    3) overlay
    4) ipvlan
    5) macvlan
    6) none



    so steps by steps we will learn each and every docker networks.


    1. Bridge - Its a default network as a bridge and if we will make container and don't make any other networks so its use by default network as a bridge from our host machine.

    So let's see how to verify we have connected through bridge while making container.  if you are followed our docker's blog continuously then you know we have already images  container that we are already uploaded.

    So, here we will run our docker desktop from our system (in windows search bar search docker desktop) are using our first command  

     

    • docker run -it --name server1 ubuntu bash

     

     

    Docker Networking


     

    Here:

    • server1  = Container Name
    • ubuntu   = Image Name
    • bash     = Command to run



    Here a ubuntu server is running even you can verify container name via 

    • docker ps



    Docker Networking


    Lets verify this docker container is connected via internet.

     

     

    Docker Networking

     

     

    So as you can see the old one images and in that container we are facing some problems to apt-get or apt install iputils-ping -y because we are unable to use ping command.

    So we will create new one file, docker images and install manually so follow the steps and do with scratch. 


    Step 1: Create a folder


    networking-dev/
    ├── Dockerfile
    



    Step 2: Create Dockerfile


    So go to your desire directory in your local machine and then create a folder

    mkdir networking-dev

    cd networking-dev  

     

    and inside the folder open vs code editor  so type a file name without any extension.

    code Dockerfile 

    add this command and save it simple.


    FROM ubuntu:24.04
    
    RUN apt-get update && \
        apt-get install -y \
        iputils-ping \
        net-tools \
        iproute2 \
        dnsutils
    
    CMD ["bash"]
    

     

    This installs:

    ping
    ifconfig
    ip
    nslookup
    other networking tools


    Step 3: Build your image


    Go inside the folder containing the Dockerfile: 

     

    • docker build -t atul/networking-dev .


     

     

    Docker Networking

     

     
    Notice the . at the end.

    Docker will:

    • Read the Dockerfile
    • Download Ubuntu 24.04
    • Install ping, net-tools, iproute2, dnsutils
    • Create image atul/networking-dev


    Verify:

    docker images

    You should see:

    REPOSITORY           TAG
    atul/networking-dev  latest

     

     

    Docker Networking

     



    Run container



    Now lets move into our real purpose of this blog docker networking via bridge

    So, here we will run our docker desktop from our system (in windows search bar search docker desktop) are using our first command  

     

    • docker run -it --name server1 atul/networking-dev


    Docker Networking


    Previously we have server1 in container docker desktop so delete it. 

    Inside container test:

    ping google.com
    ifconfig
    ip addr
    nslookup google.com

    All should work.

    • docker ps 


    C:\Users\user\Desktop\app>docker ps
    CONTAINER ID   IMAGE                 COMMAND   CREATED         STATUS         PORTS     NAMES
    98acba8d0340   atul/networking-dev   "bash"    4 minutes ago   Up 4 minutes             server1
    
    C:\Users\user\Desktop\app>
    
    
    


    Verify which network a container is using



    Run:

    • docker inspect server1


    Large output will appear.

    To see only network information:

    • docker inspect server1 --format='{{json .NetworkSettings.Networks}}'



    Output:

    {"bridge":{"IPAddress":"172.17.0.1"}}

    This means:

    Container: server1
    Network: bridge
    IP: 172.17.0.1


    Docker Networking




    Practical Demo



    Create two containers:

    • docker run -dit --name server1  atul/networking-dev
    • docker run -dit --name server2  atul/networking-dev


    Check:


    docker ps


    After creating server in another terminal lets check IP address even try to ping each other

    hostname -I 

    ping 172.17.0.2 


    Docker Networking


    We are able because both are connected with docker network by default bridge.

    Enter server1:

    docker exec -it server1 bash

    Try:

    ping server2

    On the default bridge network, name resolution may not work as expected.

     

    root@98acba8d0340:/# ping server2
    ping: server2: Name or service not known
    root@98acba8d0340:/#
    
    

     

    we are not able to ping because of they are only default network as an IP address.

     A better practice is creating your own network: so for this open new terminal and run this command 

    • docker network create mynetwork



    Docker Networking



    open another terminal and type this command with server3 and --network mynetwork

     

    hostname -I 

    you can see the IP there is -  172.18.0.2 but this is in another class - 18 and previous one are in 17 class



    Docker Networking


    Now we want to connect server 1 with my network mynetwork

    and you can see in server1 having two different class IP

     

     

    Docker Networking


    now we are able to run using name 

     

     

    Docker Networking


     

     

    These are commands that we have used 

    docker network ls
    docker inspect server1
    docker network create mynetwork
    docker run --network mynetwork ...




    Conclusion



    Understanding Dockerfiles, custom image creation, and environment variables is essential for anyone learning Docker, DevOps, Cloud Computing, or System Administration.

    By mastering these concepts, you'll be able to create reusable Docker images, automate deployments, and configure applications efficiently. These skills are widely used in real-world production environments and are frequently asked about in DevOps and System Engineer interviews.




  • How to mount any local machine file or folder with docker container volume

     

    How to mount any local machine file or folder with docker container

     

    Docker Volumes



    What is a Docker Volume?

    A Docker Volume is used to store data permanently, even if the container is deleted.


    Without a volume:

    Container Deleted
          ↓
    Data Deleted
      



    With a volume:

     

    Container Deleted
          ↓
    Data Remains Safe  
    

     

     

    Why Do We Need Volumes?


    Imagine a MySQL container:

    • docker run mysql


    All database data is inside the container.


    If the container is removed:

    • docker rm mysql-container


    Your database is gone. 

     

    Docker local file to docker container


    How to use docker volume inside the docker ?


    First we will create a file or file with code in local machine and then mount with docker and run nodejs code with nodemon and we will see live code's output in docker.

    In our local machine --> go to desktop --> creating new folder --> then open in vs code --> then mount it

    • cd Desktop
    • mkdir app
    • code app



    Mount it 

    • docker run -it node:latest


     

    How to mount any local machine file or folder with docker container volume

     

     Now we will mount from in our local machine's folder that we have created a folder name is app wtih node folder. so for this you can check our folder is there - docker container ls -a 

     

     

    How to mount any local machine file or folder with docker container volume

     

     use this command - docker run -it -v 

     

    • -it -> interactive mode
    • -v -> volume (with which you can attach any volume from your own machine to our docker container).
    • copy of address of my folder 
    • :   -> then mount with my container's address 

     

     

    How to mount any local machine file or folder with docker container volume

     

    then you can see the above image and if we type uname there is linux and we will go docker container's directory cd home then ls for list directory.

     cd app

    ls

    there is a file called index.js  

    index.js file is coming from our local machine. 

     

     

    How to mount any local machine file or folder with docker container volumeHow to mount any local machine file or folder with docker container volume

     you can check here cat index.js 

     

     

    How to mount any local machine file or folder with docker container volume

     

    Now we will nodemon in our container and will run our node js file and if we try to change from our local machine then it will effect in our container where as we did run nodemon index.js file.

    so first we will install nodemon as a globally.

    npm install -g nodemon

      

     

    How to mount any local machine file or folder with docker container volume

     

    then we will run nodemon index.js  

     

     

    How to mount any local machine file or folder with docker container volume

     

     if we change anything in our file index.js in our local machine then it will changes effect here because both are pointing same memory location and so if you are unable to changes anything as a output so run this command.

    nodemon -L index.js 

     

     

    How to mount any local machine file or folder with docker container volume



    Second way to create docker volume

     

    This is the way to mount any file to docker container and now we will try to create a docker volume so for this  type this command and as well as open docker desktop that we have installed in previous blog article - check out Here - 

    CLICK HERE

    docker volume create data 

     

    data -> is the name of volume 

     

      

    How to mount any local machine file or folder with docker container volume


    Now you can check here if we type this command - docker volume ls

    here it is showing  local as a our Driver local machine 

    and

    Volume name as a data that we have created just now 

    Now we will attach our data volume to our docker container 

    use this command - 

    docker run -it -v data:/data node bash 

    Here you can check here is a folder called as data so go to this data folder and again type ls command and nothing is there 


    How to mount any local machine file or folder with docker container volume

    so we will create a file or folder atul.js for data volume and you can use this command mkdir atul.js and type again ls atul.js



    How to mount any local machine file or folder with docker container volume


    so now we can say that what we have created a data volume that its attached with our local file. so for this you see this

    open another terminal and type this command - 

    docke run -it -v data:/myapp ubuntu 

    go to this this directory

    cd myapp

    ls

    and you can see that there is same atul.js is there   



    How to mount any local machine file or folder with docker container volume


    lets say if we create a another file or folder in previous container terminal so we are able to see in another same file in our data volume because we have create a volume called as data and each and every container file pushed in volume data.

     

     

    How to mount any local machine file or folder with docker container volume


    So we have created a two different container and attached with data volume and now you can see the result.


     

     

    How to mount any local machine file or folder with docker container volume


    Conclusion



    Understanding Dockerfiles, custom image creation, and environment variables is essential for anyone learning Docker, DevOps, Cloud Computing, or System Administration.

    By mastering these concepts, you'll be able to create reusable Docker images, automate deployments, and configure applications efficiently. These skills are widely used in real-world production environments and are frequently asked about in DevOps and System Engineer interviews.



  • Dockerfile, Custom Images, and Environment Variables Explained for Beginners

     

    Dockerfile, Custom Images, and Environment Variables Explained for Beginners

     

     

    Dockerfile, Custom Images, and Environment Variables Explained for Beginners



    Docker is one of the most important technologies in modern DevOps, cloud computing, and software deployment. After learning Docker Images and Containers, the next step is understanding Dockerfiles, building custom images, and using environment variables. 
    Learn Dockerfile, custom Docker image creation, and environment variables with practical examples. A beginner-friendly Docker guide for DevOps and System Engineers.

    In this guide, you'll learn these concepts with practical examples.


    What is a Dockerfile?



    A Dockerfile is a text file that contains instructions for building a Docker image. Instead of manually configuring containers every time, you can define all steps inside a Dockerfile and create reproducible images.

    Example:

     

    dockerfile
    FROM nginx
    COPY index.html /usr/share/nginx/html/index.html
      




    In this example:

    • * FROM nginx uses the Nginx image as the base image.
    • * COPY copies a webpage into the Nginx web server directory.


    Docker reads these instructions and builds a custom image.



     Common Dockerfile Instructions



    FROM

    • Specifies the base image.
    • FROM ubuntu



     WORKDIR

    Sets the working directory inside the container.


    • WORKDIR /app



     COPY

    Copies files from the host machine into the container.

    • COPY . .



    RUN

    Executes commands during image creation.


    • RUN npm install



    CMD

    Defines the default command executed when the container starts.


    • CMD ["node","server.js"]



    Building Custom Docker Images

    Let's create a simple custom image.

     

    Project Structure

     

    text
    project/
    │
    ├── Dockerfile
    ├── index.html
    
    

     



    Dockerfile


    • FROM nginx
    • COPY index.html /usr/share/nginx/html/index.html




    Build the Image



    Run the following command inside the project directory:

    • docker build -t mywebsite . 

     

     
    Explanation:
     

    • docker build creates a Docker image.
    • -t assigns a tag or image name.
    • mywebsite is the image name.
    • .  represents the current directory.



     

    Verify the Image


    • docker images



    You should see:


    • REPOSITORY
    • mywebsite




    Run the Custom Image


    • docker run -d -p 8080:80 mywebsite


    Open:


    • http://localhost:8080


    Your custom webpage should now be visible in the browser.

     

     

     

    What Are Environment Variables?



    Environment variables allow you to pass configuration values to containers without modifying application code.

    This makes applications easier to manage and deploy.

    Example:


    • docker run -e APP_NAME=HackingTruth nginx



    Here:

     

    • APP_NAME=HackingTruth



    is an environment variable available inside the container.


     

    Multiple Environment Variables

     

     

    docker run \
    -e DB_HOST=localhost \
    -e DB_USER=root \
    -e DB_PASSWORD=password \
    myapp
    
    

     

    This approach is commonly used for:

    • * Database credentials
    • * API keys
    • * Application settings
    • * Deployment configuration



    Defining Environment Variables in Dockerfile


    You can also define variables directly inside a Dockerfile.


    • FROM ubuntu
    • ENV APP_NAME=HackingTruth
    • ENV VERSION=1.0



    Build the image:

    • docker build -t myapp .



    Run the container:

    • docker run myapp



    The environment variables will be available inside the container.


    Why Use Dockerfiles and Environment Variables?



    Dockerfiles provide:

    • * Consistent deployments
    • * Reproducible environments
    • * Easier automation



    Environment variables provide:

    • * Better configuration management
    • * Improved security practices
    • * Easier deployment across environments


    Together, they form the foundation of modern containerized applications.


    Conclusion



    Understanding Dockerfiles, custom image creation, and environment variables is essential for anyone learning Docker, DevOps, Cloud Computing, or System Administration.

    By mastering these concepts, you'll be able to create reusable Docker images, automate deployments, and configure applications efficiently. These skills are widely used in real-world production environments and are frequently asked about in DevOps and System Engineer interviews.



  • docker-installation-images-containers-port-mapping-guide


    docker-installation-images-containers-port-mapping-guide

     


    Docker is a platform that allows developers and system administrators to package applications and their dependencies into containers. Containers are lightweight, portable and run consistently across different computing environment.



    Docker Learning Path for You



    Week 1

    • Install Docker 
    • Containers vs Images 
    • Pull images 
    • Run containers 
    • Port mapping 



    Week 2 

    • Dockerfile 
    • Build custom images 
    • Environment variables 



    Week 3 


    • Docker Volumes 
    • Docker Networks 
    • Multi-container 
    • applications 



    Week 4 

    • Docker Compose 
    • Deploy React/Node applications 
    • Container troubleshooting 



    But we will start from week 1 module and try to answer the interview level question also 

     

     Install Docker 

     

     For installing the docker via docker-desktop and via wsl linux. you can choose any of the them or both so check it here for previously we have done this part and many things you can learn from other blog article.

     

    Click Here 

     

    Containers vs Images


    This is one of the most common Docker interview questions.


    • Docker Image


    An Image is like a blueprint or template.



    Think of it like:

    Windows ISO File
         ↓
    Install Windows
         ↓
    Running Windows OS
      



    Similarly:
    Docker Image
        ↓
    Run Image
        ↓
    Docker Container
    




    Examples of Images:

    • nginx
    • ubuntu
    • mysql
    • node



    View downloaded images:

    • docker images




    Example output:


    docker-installation-images-containers-port-mapping-guide

     

    Docker Container



    A Container is a running instance of an image or Containers are standardized software units that package code and dependencies together, ensuring an application runs quickly and reliably across any computing environment. 


    Example:

    • docker run nginx


    Docker:

    • Checks for nginx image
    • Downloads it if missing
    • Creates container
    • Starts container


    View running containers:  list running container and verify 

    docker ps

     

     docker-installation-images-containers-port-mapping-guide

     

     

     Interview Answer


    What is the difference between Image and Container?



    Image


    • Read-only template
    • Used to create containers
    • Similar to an ISO file



    Container

    • Running instance of an image
    • Has its own process and network
    • Similar to an installed/running operating system

     

     

    Pull Images



    What is Pull?

    Downloading an image from Docker Hub to your local machine.

    Example:

    docker pull nginx


    Docker downloads:

    • nginx:latest
    • Pull Ubuntu
    • docker pull ubuntu



    Check downloaded images:

    • docker images
    • Pull Specific Version
    • docker pull nginx:1.27




    Why?


    In production we often use specific versions instead of latest.


    Interview Question



    What does docker pull do?

    Answer:

    docker pull downloads an image from a registry such as Docker Hub to the local Docker host.

    like this hello-world repo or registry -





    docker-installation-images-containers-port-mapping-guide



     Port Mapping


    This is extremely important.



    Without Port Mapping


    Run nginx:

    • docker run nginx
    • Container runs internally.
    • You cannot access it from your browser.


    With Port Mapping

    • docker run -d -p 8080:80 nginx






    Meaning:

    • Host Machine Port = 8080
    • Container Port = 80



    Visualization:


    Your Laptop
    localhost:8080
            │
            ▼
    Docker Container
    Port 80 (Nginx)



    Test


    Open browser:

    http://localhost:8080

    You should see:

    Welcome to nginx!



    docker-installation-images-containers-port-mapping-guide






    Another Example


    Node.js app running on port 3000 inside container:

    • docker run -d -p 3000:3000 myapp



    Meaning:

    • Host 3000 → Container 3000
    • Check Port Mapping
    • docker ps



    Example:

    PORTS

    • 0.0.0.0:8080->80/tcp



    Meaning:

    Host Port 8080
               ↓
    Container Port 80


     

     

    Commands You Must Remember



    Pull image:

    • docker pull nginx


    List images:

    • docker images


    Run container:

    • docker run nginx


    Run in background:

    • docker run -d nginx


    Port mapping:

    • docker run -d -p 8080:80 nginx


    Running containers:

    • docker ps



    All containers:

    • docker ps -a





    Before moving to Week 2, make sure you can confidently explain:

    ✅ What is Docker?
    ✅ What is an Image?
    ✅ What is a Container?
    ✅ What is Docker Hub?
    ✅ What is docker pull?
    ✅ What is port mapping?
    ✅ Difference between docker ps and docker images?
    ✅ Meaning of 8080:80?

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking. 
     
     
     
     
     
  • WHAT WE DO

    We've been developing corporate tailored services for clients for 30 years.

    CONTACT US

    For enquiries you can contact us in several different ways. Contact details are below.

    Hacking Truth.in

    • Street :Road Street 00
    • Person :Person
    • Phone :+045 123 755 755
    • Country :POLAND
    • Email :contact@heaven.com

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.