-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·50 lines (33 loc) · 1.04 KB
/
setup.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
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# My first script to setup Ubuntu 16.04 Linux to install Docker.
### Install system needed updates ###
# ensure running as root
clear
echo "Script to Update and install Docker on Ubuntu 16.04"
echo " "
echo "MUST BE RUN ON A FRESH INSTALL !!"
echo " "
echo "Please enter your password for Root installation"
echo " "
if [ "$(id -u)" != "0" ]; then
exec sudo "$0" "$@"
fi
apt update -y
dpkg --configure -a
apt upgrade -y
apt install -y unzip wget curl
### Install Docker Components ###
apt-get update
apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update -y
apt-get install docker-ce -y
systemctl enable docker
groupadd docker
usermod -a -G docker $USER
service docker restart
### Create a key for SSH login
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
clear
echo "Please Reboot the system by running sudo reboot"