Skip to content

Instantly share code, notes, and snippets.

@davix3f
Last active September 5, 2022 21:19
Show Gist options
  • Save davix3f/1cfe835ad5000f6a3e83a0c02a51bfb1 to your computer and use it in GitHub Desktop.
Save davix3f/1cfe835ad5000f6a3e83a0c02a51bfb1 to your computer and use it in GitHub Desktop.
Fast docker install script for Debian
#!/bin/bash
# March 14th 2022
# (d)ocker (p)ropietary (r)epo (i)install
# this script is nothing but the commands located at https://docs.docker.com/engine/install/debian/
# I'm just placing them all in one script to run for a faster installation without copypasting everytime
# so not of this is my original work
apt update && apt upgrade -y
# check run as root or as sudo
if [ $(id -u) -ne 0 ]
then echo "Please run as root/sudo"
exit
else echo "Running install script (creation date: March 14th 2022)"
fi
apt-get remove docker docker-engine docker.io containerd runc
apt-get install ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment