Dynamically adjust url and gpg key
This commit is contained in:
parent
76c5dc8363
commit
df127f63e2
@ -38,19 +38,22 @@ class ToolsInstaller:
|
||||
if "download.docker.com/linux/" not in line.lower():
|
||||
print("apt-repo is not installed, setting up docker apt-key")
|
||||
if "ubuntu" in platform.version().lower():
|
||||
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)
|
||||
linux_distro = "ubuntu"
|
||||
elif "debian" in platform.version().lower():
|
||||
subprocess.run("curl -fsSL https://download.docker.com/linux/debian/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/debian $(lsb_release -cs) stable\"",
|
||||
shell=True)
|
||||
linux_distro = "debian"
|
||||
else:
|
||||
print("Version not supported by this installer")
|
||||
return
|
||||
|
||||
subprocess.run("curl -fsSL "
|
||||
f"https://download.docker.com/linux/${linux_distro}/gpg "
|
||||
"| sudo apt-key add -",
|
||||
shell=True)
|
||||
subprocess.run("apt-key fingerprint 0EBFCD88", shell=True)
|
||||
subprocess.run("add-apt-repository \"deb [arch=amd64] "
|
||||
f"https://download.docker.com/linux/${linux_distro}"
|
||||
"$(lsb_release -cs) stable\"",
|
||||
shell=True)
|
||||
else:
|
||||
print("skip adding of the key")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user