Posted on
Software

docker: Container platform

Author
  • User
    Linux Bash
    Posts by this author
    Posts by this author

Optimizing Your Development Workflow with Docker on Linux Bash

In today’s ever-evolving software environment, Docker has revolutionized how applications are developed, shipped, and deployed. This powerful tool helps you to create, deploy, and run applications using containers. Containers allow developers to package up an application with all the parts it needs—libraries and other dependencies—and ship it all out as one package.

Docker is particularly useful for Linux users, providing an isolated, consistent, and reproducible environment across various development, testing, and production setups. To get started with Docker on your Linux system using Bash, follow this comprehensive guide on installing Docker via different package managers like apt, dnf, and zypper.

Pre-requisites

Before we dive into the installation process, ensure that your system meets the following requirements:

  • 64-bit version of any Linux distribution (Ubuntu, Debian, Fedora, SUSE, etc.)

  • sudo or root access

  • Minimum of 4GB RAM (recommended)

Installing Docker on Ubuntu and Debian Systems (using apt)

Ubuntu and Debian are among the most popular Linux distributions, utilizing the Advanced Packaging Tool (APT) for package management. Here’s how you can install Docker on them:

  1. Update Your Package Index:

    sudo apt-get update
    
  2. Install Required Packages:

    sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
    
  3. Add the Official Docker Repository:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    
  4. Install Docker Engine:

    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io
    
  5. Verify Installation:

    sudo docker run hello-world
    

Installing Docker on Fedora (using dnf)

Fedora uses the dnf package manager. Here's how to install Docker on Fedora:

  1. Install Required Packages:

    sudo dnf -y install dnf-plugins-core
    
  2. Add the Docker Repository:

    sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
    
  3. Install Docker Engine:

    sudo dnf install docker-ce docker-ce-cli containerd.io
    
  4. Start Docker and Enable it at Boot:

    sudo systemctl start docker
    sudo systemctl enable docker
    
  5. Verify Installation:

    sudo docker run hello-world
    

Installing Docker on openSUSE or SUSE Linux Enterprise (using zypper)

SUSE systems use the zypper package manager. To install Docker, follow these steps:

  1. Add the Docker Repository:

    sudo zypper addrepo https://download.docker.com/linux/suse/x86_64/stable/docker.repo
    
  2. Install Docker:

    sudo zypper install docker
    
  3. Start Docker:

    sudo systemctl start docker
    
  4. Enable Docker to Start at Boot:

    sudo systemctl enable docker
    
  5. Verify Installation:

    sudo docker run hello-world
    

Post Installation

After installing Docker, it's highly recommended to manage Docker as a non-root user:

  1. Create the Docker Group:

    sudo groupadd docker
    
  2. Add Your User to the Docker Group:

    sudo usermod -aG docker $USER
    

Note: Log out and log back in to activate the membership.

Conclusion

By now, you should have Docker up and running on your Linux system. Docker not only simplifies the deployment of applications but also assists in achieving greater efficiency and consistency across multiple environments. Regardless of your Linux distribution, Docker can seamlessly integrate into your development pipeline, aiding in a more streamlined, scalable, and predictable development cycle.