From a73a442f078b7fcf14efea624ff93e23406264c5 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Wed, 31 Jul 2024 23:24:10 +0800 Subject: [PATCH] docker rework --- install/docker | 60 ++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/install/docker b/install/docker index a28a8a9..aced031 100755 --- a/install/docker +++ b/install/docker @@ -1,43 +1,35 @@ #!/bin/bash ##makedesc: Install docker (latest) + docker-compose (latest) + ppa - -echo -echo "===============================================" -echo "Installing docker (latest)..." -echo "===============================================" -echo +source `dirname $0`/../helpers || exit 255 # https://docs.docker.com/engine/install/ubuntu/ -sudo apt install -y \ - ca-certificates \ - curl \ - gnupg \ - lsb-release +title + +require ca-certificates +require curl +require gnupg +require lsb-release sudo mkdir -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ -| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg +| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ + sudo chmod a+r /etc/apt/keyrings/docker.gpg && \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ + | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \ + sudo apt update && \ + sudo apt install -y --autoremove \ + docker-ce \ + docker-ce-cli \ + containerd.io \ + docker-compose-plugin && \ + sudo usermod -aG docker $(whoami) -sudo chmod a+r /etc/apt/keyrings/docker.gpg - -echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ -| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - -sudo apt update -sudo apt install -y --autoremove \ - docker-ce \ - docker-ce-cli \ - containerd.io \ - docker-compose-plugin - -sudo usermod -aG docker $(whoami) - -sudo cp ../dotfiles/etc/docker/daemon.json /etc/docker/daemon.json - -echo -echo "Finish!" -docker --version -echo "Probably, you need to relogin to apply 'docker' group." -echo "Your ones currently are: $(groups)" -echo +[ $? = 0 ] && { + echo + success "Docker installed!" + info "Probably, you need to relogin to apply 'docker' group." + info "Your ones currently are: $(groups)" + docker --version + echo +}