-
Notifications
You must be signed in to change notification settings - Fork 0
/
installDocker.sh
37 lines (26 loc) · 1.25 KB
/
installDocker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Author: Arthur Cadore M. Barcella
# Github: arthurcadore
# Script to install docker and docker-compose packages:
# Removing any previous docker installations
sudo apt-get remove docker docker-engine docker.io containerd runc
# Updating package repository and installing base packages
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl -y
sudo apt-get install gnupg-agent software-properties-common -y
# Adding docker GPG key to apt repository
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Adding docker packages
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# Installing Docker
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
# Adding docker permissions to the current user:
sudo usermod -aG docker $USER
#======================================================================
# Installing Docker Compose:
# Creating a directory for compose content:
mkdir -p ~/.docker/cli-plugins
# Adding docker compose packages
curl -SL https://github.com/docker/compose/releases/download/v2.0.1/docker-compose-linuxx86_64 -o ~/.docker/cli-plugins/docker_compose
# Verifying docker compose version:
docker compose version