xxxxxxxxxx
August 2024
Docker Engine Ubuntu 22.04 LTS
This is the way. Ubuntu 22.04 -
Does not work with 24.04 without
diabling Apparmour every
reboot (see comment below)
# Official Docker Oneliner
# run this
sh <(curl -sSL https://get.docker.com)
############################################
#
# [OPTIONAL] Want Docker Compose v2?
# Cut/Paste Whole block!
#
############ cut below #####################
LATEST=$(curl -sL https://api.github.com/repos/docker/compose/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -sSL https://github.com/docker/compose/releases/download/$LATEST/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
#############################################
#############################################
# Want Portainer GUI to manage containers?
# Cut/Paste Whole block no need to do it line by line!
############ cut below #######################
docker volume create portainer_data
docker run -d \
-p 8000:8000 \
-p 9443:9443 \
--name=portainer \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer-ce:latest
##############################################
open your browser to: https://localhost:9443
##############################################
Want more?
[Optional] Install Dockge for Compose Management
############ cut below #######################
mkdir -p /opt/{dockge,stacks}
wget -q -O /opt/dockge/compose.yaml https://raw.githubusercontent.com/louislam/dockge/master/compose.yaml
cd /opt/dockge
docker compose up -d
#############################################
open your browser to: https://localhost:5001
##############################################
xxxxxxxxxx
# Update package index
sudo apt update
# Install prerequisite packages
sudo apt install apt-transport-https ca-certificates curl software-properties-common
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Add the Docker repository to APT sources
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update package index again
sudo apt update
# Install Docker engine
sudo apt install docker-ce docker-ce-cli containerd.io
# Verify installation
sudo docker run hello-world
xxxxxxxxxx
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
xxxxxxxxxx
$ sudo apt update
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common