Skip to content

Instantly share code, notes, and snippets.

@MTRNord
Created August 18, 2016 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MTRNord/824bc53f426a022b2e8e74684fc51837 to your computer and use it in GitHub Desktop.
Save MTRNord/824bc53f426a022b2e8e74684fc51837 to your computer and use it in GitHub Desktop.
Installer for the Mapit-Germany Docker
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
echo -e "Getting User Data\n"
echo -e "-------------------\n \n"
echo -e "Tell Ubuntu Verison name [precise, trusty, wily, xenial]:"
read version
echo -e "Install docker"
touch /etc/apt/sources.list.d/docker.list
echo "deb https://apt.dockerproject.org/repo ubuntu-$version main" >> /etc/apt/sources.list.d/docker.list
apt-get update
apt-get purge lxc-docker
apt-get install docker-engine make
groupadd docker
usermod -aG docker daemon
echo -e "Add run scripts"
function systemd_service {
systemctl start docker
wget https://raw.githubusercontent.com/Nordgedanken/mapit-germany-docker/master/mapit_systemd
mv mapit_systemd /etc/systemd/system/mapit.service
chmod +x /etc/systemd/system/mapit.service
}
function init_service {
service docker start
wget https://raw.githubusercontent.com/Nordgedanken/mapit-germany-docker/master/mapit_init
mv mapit_init /etc/init.d/mapit
chmod +x /etc/init.d/mapit
}
pidof systemd && systemd_service || init_service
echo -e "Ready to start\n\n Now rin 'sudo service mapit start'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment