Skip to content

USFAkbari/docker_Initiation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Docker Installation Script

A comprehensive, interactive shell script to install Docker on Debian-based Linux distributions with visual progress indicators and loading bars.

Features

  • Interactive Installation - Step-by-step progress with visual feedback
  • Loading Bars & Spinners - Real-time progress indicators during installation
  • Error Handling - Comprehensive error checking at each step
  • Automatic OS Detection - Automatically detects your OS version codename
  • Complete Setup - Installs Docker CE, CLI, Containerd, Buildx, and Compose
  • Service Management - Automatically starts and enables Docker service
  • Verification - Tests installation with hello-world container

Easy Installation

One-Line Install (Recommended)

Simply run this command in your terminal:

curl -fsSL https://raw.githubusercontent.com/USFAkbari/docker_Initiation/main/install_docker.sh | sudo bash

Alternative: Download and Run

# Download the script
curl -fsSL https://raw.githubusercontent.com/USFAkbari/docker_Initiation/main/install_docker.sh -o install_docker.sh

# Make it executable
chmod +x install_docker.sh

# Run with sudo
sudo ./install_docker.sh

Manual Installation

  1. Clone this repository:

    git clone https://github.com/USFAkbari/docker_Initiation.git
    cd docker_Initiation
  2. Make the script executable:

    chmod +x install_docker.sh
  3. Run the script with sudo:

    sudo ./install_docker.sh

Requirements

  • Operating System: Debian-based Linux distribution (Debian, Ubuntu, etc.)
  • Privileges: Root or sudo access
  • Internet Connection: Required for downloading packages and Docker images

What This Script Does

The script performs the following steps automatically:

  1. OS Detection - Detects your OS version codename
  2. Update Package List - Updates apt package list
  3. Install Prerequisites - Installs ca-certificates and curl
  4. Add Docker GPG Key - Downloads and installs Docker's official GPG key
  5. Add Docker Repository - Configures Docker's official apt repository
  6. Update Package List - Refreshes package list with Docker repository
  7. Install Docker - Installs Docker CE, CLI, Containerd, Buildx, and Compose
  8. Start Docker Service - Starts and enables Docker daemon
  9. Verify Installation - Checks Docker service status
  10. Test Installation - Runs hello-world container to verify everything works

Installation Process

During installation, you'll see:

  • Progress Indicators - Step-by-step progress (Step X/10)
  • Loading Spinners - For quick operations
  • Progress Bars - For longer operations like package installation
  • Color-Coded Messages - Green for success, yellow for warnings, red for errors

Post-Installation

After successful installation, you can:

  • Check Docker version:

    docker --version
  • Check Docker Compose version:

    docker compose version
  • Run a test container:

    docker run hello-world
  • View Docker system information:

    docker info

Troubleshooting

Permission Denied

If you get a "permission denied" error, make sure you're running the script with sudo:

sudo ./install_docker.sh

Network Issues

If the installation fails due to network issues:

  • Check your internet connection
  • Verify you can access download.docker.com
  • Check your firewall settings

GPG Key Errors

If you encounter GPG key errors:

  • The script will automatically retry
  • Make sure your system time is correct
  • Check if there are proxy settings interfering

Service Won't Start

If Docker service fails to start:

sudo systemctl status docker
sudo journalctl -u docker

Uninstallation

To remove Docker installed by this script:

sudo apt purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
sudo rm -rf /etc/apt/keyrings/docker.asc
sudo rm -rf /etc/apt/sources.list.d/docker.sources

Security Note

⚠️ Important: When using curl | sh installation method, always verify the script source. Only run scripts from trusted repositories.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This script is provided as-is for educational and practical purposes.

Support

For issues or questions, please open an issue on the GitHub repository.


Made with ❤️ for the Docker community

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages