|
@@ -294,7 +294,7 @@ func installDocker() error {
|
|
var installCmd *exec.Cmd
|
|
var installCmd *exec.Cmd
|
|
|
|
|
|
switch {
|
|
switch {
|
|
- case strings.Contains(osRelease, "ID=ubuntu") || strings.Contains(osRelease, "ID=debian"):
|
|
|
|
|
|
+ case strings.Contains(osRelease, "ID=ubuntu"):
|
|
installCmd = exec.Command("bash", "-c", `
|
|
installCmd = exec.Command("bash", "-c", `
|
|
apt-get update &&
|
|
apt-get update &&
|
|
apt-get install -y apt-transport-https ca-certificates curl software-properties-common &&
|
|
apt-get install -y apt-transport-https ca-certificates curl software-properties-common &&
|
|
@@ -303,6 +303,15 @@ func installDocker() error {
|
|
apt-get update &&
|
|
apt-get update &&
|
|
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
|
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
|
`)
|
|
`)
|
|
|
|
+ case strings.Contains(osRelease, "ID=debian"):
|
|
|
|
+ installCmd = exec.Command("bash", "-c", `
|
|
|
|
+ apt-get update &&
|
|
|
|
+ apt-get install -y apt-transport-https ca-certificates curl software-properties-common &&
|
|
|
|
+ curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg &&
|
|
|
|
+ echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list &&
|
|
|
|
+ apt-get update &&
|
|
|
|
+ apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
|
|
|
+ `)
|
|
case strings.Contains(osRelease, "ID=fedora"):
|
|
case strings.Contains(osRelease, "ID=fedora"):
|
|
installCmd = exec.Command("bash", "-c", `
|
|
installCmd = exec.Command("bash", "-c", `
|
|
dnf -y install dnf-plugins-core &&
|
|
dnf -y install dnf-plugins-core &&
|
|
@@ -332,7 +341,6 @@ func installDocker() error {
|
|
default:
|
|
default:
|
|
return fmt.Errorf("unsupported Linux distribution")
|
|
return fmt.Errorf("unsupported Linux distribution")
|
|
}
|
|
}
|
|
-
|
|
|
|
installCmd.Stdout = os.Stdout
|
|
installCmd.Stdout = os.Stdout
|
|
installCmd.Stderr = os.Stderr
|
|
installCmd.Stderr = os.Stderr
|
|
return installCmd.Run()
|
|
return installCmd.Run()
|