|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +############################# |
| 4 | +# Prerequisites |
| 5 | +# Pip |
| 6 | +# Pipx |
| 7 | +# docker.io |
| 8 | +# Docker compose |
| 9 | +# Go |
| 10 | +############################# |
| 11 | + |
| 12 | +# Update Ubuntu, answer yes to all prompts non-interactively |
| 13 | +sudo apt update --yes |
| 14 | + |
| 15 | +# Install pip |
| 16 | +sudo apt install python3-pip --yes |
| 17 | + |
| 18 | +# Install Pipx |
| 19 | +sudo apt install pipx --yes |
| 20 | + |
| 21 | +# Install Go |
| 22 | +sudo apt install golang-go --yes |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +# Install Docker Compose |
| 28 | +# Install ca-certificates, a certificate authority package for verifying third-party identities, and curl, a data transfer tool: |
| 29 | +sudo apt install ca-certificates curl |
| 30 | + |
| 31 | +# Set ownership permissions for the /etc/apt/keyrings directory: |
| 32 | +sudo install -m 0755 -d /etc/apt/keyrings |
| 33 | + |
| 34 | +# Download the key with curl: |
| 35 | +sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc |
| 36 | + |
| 37 | +# Set read permissions for the key: |
| 38 | +sudo chmod a+r /etc/apt/keyrings/docker.asc |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +# Add the Docker repository to the list of APT sources: |
| 46 | +echo \ |
| 47 | + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ |
| 48 | + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ |
| 49 | + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
| 50 | + |
| 51 | +# Install Docker Compose: |
| 52 | +sudo apt install docker-compose-plugin -y |
| 53 | + |
| 54 | +# Install Docker.io |
| 55 | +sudo apt install docker.io |
| 56 | + |
| 57 | +# After the download completes, confirm that Docker Compose is installed by typing: |
| 58 | +docker compose version |
| 59 | + |
| 60 | +# Create the docker group if it does not already exist: |
| 61 | +sudo groupadd -f docker |
| 62 | +# Add the current user to the docker group via the usermod command: |
| 63 | +sudo usermod -aG docker $USER |
| 64 | +# Start docker service |
| 65 | +sudo service docker start |
| 66 | + |
0 commit comments