my-env/install/docker

36 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/bin/bash
##makedesc: Install docker (latest) + docker-compose (latest) + ppa
2024-07-31 15:24:10 +00:00
source `dirname $0`/../helpers || exit 255
# https://docs.docker.com/engine/install/ubuntu/
2024-07-31 15:24:10 +00:00
title
require ca-certificates
require curl
require gnupg
require lsb-release
2022-08-25 04:40:21 +00:00
sudo mkdir -p /etc/apt/keyrings
2023-02-01 14:29:02 +00:00
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
2024-07-31 15:24:10 +00:00
| 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)
[ $? = 0 ] && {
echo
success "Docker installed!"
info "Probably, you need to relogin to apply 'docker' group."
info "Your ones currently are: $(groups)"
docker --version
echo
}