Skip to content

Commit 4c89cb0

Browse files
committed
System setup script
1 parent 7823a03 commit 4c89cb0

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

system/setup-debian.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
#==
3+
# Script to set up a new Debian 11 machine to support BlogDB with docker & dex.
4+
#==
5+
6+
if $UID -ne 0; then
7+
echo "Error: This script must be run as root.";
8+
exit -1;
9+
fi
10+
11+
#==
12+
# Update the packages and install supporting software.
13+
#==
14+
apt-get update -y;
15+
apt-get upgrade -y;
16+
apt-get install -y git build-essential cpanminus liblocal-lib-perl;
17+
18+
#==
19+
# Install Docker
20+
#==
21+
22+
# Install packages we need to have in order to install docker.
23+
apt-get update -y;
24+
apt-get install -y ca-certificates curl gnupg lsb-release;
25+
26+
# Get keys from docker for their packages.
27+
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg;
28+
29+
# Add the docker apt repo.
30+
echo \
31+
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
32+
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list;
33+
34+
# Finally, actually install docker.
35+
apt-get update -y;
36+
apt-get install -y docker-ce docker-ce-cli containerd.io;
37+
38+
# Setup local::lib for the future and then enable it for the rest of this script.
39+
40+
echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >> /root/.bashrc;
41+
source /root/.bashrc;
42+
43+
# Install App::Dex
44+
cpanm App::Dex
45+
46+
echo
47+
echo
48+
echo "The system is now setup to run docker containers from root."
49+
echo
50+
echo "You should exit this shell and reconnect, or source ~/.bashrc"
51+
echo "so that your perl environment will be setup and dex will run."
52+
echo
53+
echo "Then, get BlogDB and proceed:"
54+
echo "SSH: git@github.com:symkat/BlogDB.git"
55+
echo "HTTP: https://github.com/symkat/BlogDB.git"
56+
echo

0 commit comments

Comments
 (0)