DOCKER INSTALLATION SHELL SCRIPT

shivdevops

shiv

Posted on July 21, 2020

DOCKER INSTALLATION SHELL SCRIPT

!/bin/bash

Checks whether docker installed or not:

   if [ ! -x /var/lib/docker ]; then

echo "INSTALLING docker"

Installing software dependencies:

     echo "Y" | apt install apt-transport-https ca-certificates curl software-properties-common

Adding the Docker key in repository:

     curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

    add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"

Updating the system:

    echo "Y" | apt update

Installing Docker:

    apt-cache policy docker-ce

    echo "Y" | sudo apt install docker-ce

     echo "docker successfully installed"

Shows message if docker already installed during initial check:

  else
   echo "DOCKER ALREADY INSTALLED"
   fi

Installation Shell Script for Docker Available in Github Repo

💖 💪 🙅 🚩
shivdevops
shiv

Posted on July 21, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related