Skip to content

Instantly share code, notes, and snippets.

@scry3r
Last active July 9, 2017 09:45
Show Gist options
  • Save scry3r/52714b6af94cc399d74d75951e290242 to your computer and use it in GitHub Desktop.
Save scry3r/52714b6af94cc399d74d75951e290242 to your computer and use it in GitHub Desktop.
#!/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
sudo apt-get update
sudo apt-get -y install curl
curl -sSL https://get.docker.com/ | sh
sudo apt-get -y install python-pip
pip install docker-compose
sudo 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