2022-12-04 11:49:15 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-12-12 20:38:44 +01:00
|
|
|
# This installs Docker on Ubuntu Linux
|
2022-12-04 11:49:15 +01:00
|
|
|
# bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-docker.sh)
|
|
|
|
|
|
|
|
echo "Installing Docker..."
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Install distribution packages.
|
|
|
|
sudo apt-get update
|
2022-12-04 11:51:04 +01:00
|
|
|
sudo apt-get -qq install ca-certificates curl gnupg lsb-release
|
2022-12-04 11:49:15 +01:00
|
|
|
|
|
|
|
# Install key.
|
|
|
|
sudo mkdir -p /etc/apt/keyrings
|
2023-03-22 18:49:30 +01:00
|
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
2022-12-04 11:49:15 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
# Install Docker with Compose Plugin.
|
|
|
|
sudo apt-get update
|
2022-12-30 19:49:18 +01:00
|
|
|
sudo apt-get -qq install docker-ce docker-ce-cli docker-ce-rootless-extras containerd.io docker-compose-plugin cgroupfs-mount libltdl7 pigz
|
2022-12-04 11:49:15 +01:00
|
|
|
|
2023-03-27 09:30:17 +02:00
|
|
|
# Add docker-compose alias for Compose Plugin.
|
|
|
|
if [ ! -f "/bin/docker-compose" ]; then
|
|
|
|
echo 'docker compose "$@"' | sudo tee /bin/docker-compose
|
|
|
|
sudo chmod +x /bin/docker-compose
|
|
|
|
fi
|
|
|
|
|
2022-12-04 11:49:15 +01:00
|
|
|
# Verify installation works.
|
|
|
|
sudo docker run hello-world
|