diff --git a/modules/install/ToolsInstaller.py b/modules/install/ToolsInstaller.py index 0a0d408..7a758b1 100644 --- a/modules/install/ToolsInstaller.py +++ b/modules/install/ToolsInstaller.py @@ -13,11 +13,28 @@ class ToolsInstaller: print("Try to install basic Command-line tools") programs_list = " ".join(p for p in self.programs_json['basic-tools']) - subprocess.run("apt install" + programs_list, shell=True) + subprocess.run("apt-get install" + programs_list, shell=True) print("Script ran to completion.") def hard_drive_tools(self): """Install tools to look up smart information from your hard-drives""" programs_list = " ".join(p for p in self.programs_json['hard-drive']) - subprocess.run("apt install " + programs_list, shell=True) + subprocess.run("apt-get install " + programs_list, shell=True) + + def docker(self): + """Install the Docker service on the machine""" + print("Removing any old installations") + subprocess.run("apt-get remove docker docker-engine docker.io containerd runc", shell=True) + print("Set up docker apt-key") + subprocess.run("apt-get update", shell=True) + subprocess.run("apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common", shell=True) + subprocess.run("curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -", shell=True) + subprocess.run("apt-key fingerprint 0EBFCD88", shell=True) + subprocess.run("add-apt-repository " + "\"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs)stable\"", shell=True) + print("Installing the Service") + subprocess.run("apt-get update", shell=True) + subprocess.run("apt-get install docker-ce docker-ce-cli containerd.io", shell=True) + print("Checking the installation") + subprocess.run("docker run hello-world", shell=True)