mongo-replica-initializer/inst_docker.go

41 lines
925 B
Go

package main
import(
"fmt"
"os/exec"
)
func Inst_docker_ubuntu() {
fmt.Printf("\n\033[1;32mInstalling Docker CE from official repo\033[0m\n")
docker_install := `
apt update
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin`
exec.Command(docker_install)
}
func Inst_docker_debian() {
fmt.Println()
}
func Inst_docker_fedora() {
fmt.Println()
}
func Inst_docker_redhat() {
fmt.Println()
}
func Inst_docker_opensuse() {
fmt.Println()
}