You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1.0 KiB
Bash
25 lines
1.0 KiB
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
########################
|
|
### SCRIPT VARIABLES ###
|
|
########################
|
|
|
|
# Name of the user to create and grant sudo privileges
|
|
USERNAME=yourusername
|
|
|
|
apt update
|
|
apt install apt-transport-https ca-certificates curl software-properties-common
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
|
echo "deb [arch=$(dpkg --print-architecture) 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
|
|
apt update
|
|
apt-cache policy docker-ce
|
|
apt install docker-ce
|
|
systemctl status docker
|
|
usermod -aG docker ${USERNAME}
|
|
|
|
# Install Docker-Compose - Do this with a regular user account not as root
|
|
mkdir -p ~/.docker/cli-plugins/
|
|
curl -SL "https://github.com/docker/compose/releases/download/v2.11.2/docker-compose-$(uname -s)-$(uname -m)" -o ~/.docker/cli-plugins/docker-compose
|
|
chmod +x ~/.docker/cli-plugins/docker-compose
|
|
docker compose version |