Last active
June 24, 2020 08:20
-
-
Save bisubus/2e49df20b0f0a825336b906b7d9655f6 to your computer and use it in GitHub Desktop.
Installation script for docker and docker-compose, Debian and Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
confirm () { | |
read -r -p "${1:-Are you sure? [y/N]} " response | |
case $response in | |
[yY][eE][sS]|[yY]) | |
# true | |
echo 1; | |
;; | |
*) | |
#false | |
echo 0; | |
;; | |
esac | |
} | |
echo "It is ok to have 'docker command appears to already exist on this system'" | |
echo "warning if 'docker' has been installed with this script and deleted afterwards." | |
echo | |
CONFIRM="$(confirm 'Install docker and docker-compose? [y/N]')" | |
if [ $CONFIRM -eq 1 ] | |
then | |
apt-get update | |
apt-get -y install curl | |
curl -sSL https://get.docker.com/ | sh | |
apt-get -y install python-pip | |
pip install docker-compose | |
apt-get -y autoremove | |
echo | |
echo "Don't forget to add your user to the 'docker' group with" | |
echo " sudo usermod -aG docker your-user" | |
echo "or" | |
echo " sudo usermod -aG docker \$(whoami)" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment