Add docker in installer
This commit is contained in:
parent
6a90c0fa90
commit
dcb8374f70
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user