📦 Overview

Simulate a multi-node server environment using Docker Compose. Each container runs Ubuntu with SSH, named uniquely and mapped to an auto-incremented host port—ideal for testing distributed software and configuration management tools.

⚙️ Prerequisites

On Ubuntu, for example:

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io
sudo usermod -aG docker ${USER} && su - ${USER}

🚀 Installation & Setup

  1. Clone the repository:
    git clone https://github.com/Pradipbabar/MultiNodeTestLab.git
    cd MultiNodeTestLab
  2. Generate an SSH key pair (if you don’t have one):
    ssh-keygen -t rsa -b 4096
  3. Adjust `Dockerfile` or `docker-compose.yml` if you need custom SSH keys or user setup.
  4. Build and start containers:
    docker-compose up -d

🔑 Accessing Containers

List running containers:

docker ps

SSH into a container (replace `` and ``):

ssh -i ~/.ssh/id_rsa -p  root@localhost

🔥 Usage Scenarios

⚙️ Configuration

The core definitions live in docker-compose.yml:

services:
  node1:
    build: .
    container_name: node1
    ports:
      - "2201:22"
  node2:
    build: .
    container_name: node2
    ports:
      - "2202:22"
  # …

Adjust the nodes/ directory to add startup scripts, custom packages, or configuration for each node.