diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-06-06 08:17:18 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-06-06 08:17:18 -0300 |
commit | 515bdd658d91020c73f82b70ff001015b359adc0 (patch) | |
tree | e7c62578e2ef61bf7c9a46de91d92d37620553fe /bin/provision-docker | |
download | bookup-515bdd658d91020c73f82b70ff001015b359adc0.tar.gz bookup-515bdd658d91020c73f82b70ff001015b359adc0.tar.bz2 |
Initial import
Diffstat (limited to 'bin/provision-docker')
-rwxr-xr-x | bin/provision-docker | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/provision-docker b/bin/provision-docker new file mode 100755 index 0000000..d24ea56 --- /dev/null +++ b/bin/provision-docker @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Provisioner for Docker +# + +# Check for sudo +if [ "`whoami`" != "root" ]; then + SUDO="sudo" +fi + +# Parameters +# See https://wiki.debian.org/Backports#Finding_backports +COMPOSE_BACKPORT="`apt show docker-compose -a 2> /dev/null | grep backports | awk '{ print $3 }' | cut -d '/' -f 1`" + +# Ensure an up-to-date system +$SUDO apt-get update +$SUDO apt-get upgrade -y + +# Check for backport availability for Debian bookworm +if [ "$COMPOSE_BACKPORT" == "bookworm-backports" ]; then + COMPOSE_BACKPORTS="-t $COMPOSE_BACKPORT" +fi + +# Docker and docker-compose from distribution +$SUDO apt-get install $COMPOSE_BACKPORTS -y docker.io docker-compose + +# Put the regular user into docker group +$SUDO usermod -a -G docker $(whoami) |