DEV Community

shiv
shiv

Posted on

3

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

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay