Last active
December 27, 2015 07:49
-
-
Save juranki/7292094 to your computer and use it in GitHub Desktop.
This file contains 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
!/usr/bin/env bash | |
# this script assumes a fresh Arch Linux 2013.05 x64 | |
export PLUGINHOOK_REPO=${DOKKU_REPO:-"https://github.com/progrium/pluginhook.git"} | |
export DOKKU_REPO=${DOKKU_REPO:-"https://github.com/juranki/dokku.git"} | |
# filesystem conflicts with some other system, so ignore it first | |
pacman -Syu -q --noconfirm --ignore filesystem | |
pacman -S -q --noconfirm --needed \ | |
filesystem \ | |
base-devel \ | |
git \ | |
wget \ | |
go \ | |
mercurial | |
function check_install { | |
echo `which $1` | |
if [ ! `which $1` ]; then | |
echo "installing ${1} failed. quitting." | |
exit | |
fi | |
} | |
if [ ! `which package-query` ]; then | |
cd ~ | |
curl -O https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz | |
tar zxvf package-query.tar.gz | |
cd package-query | |
makepkg -si --asroot --noconfirm | |
fi | |
check_install package-query | |
if [ ! `which yaourt` ]; then | |
cd ~ | |
curl -O https://aur.archlinux.org/packages/ya/yaourt/yaourt.tar.gz | |
tar zxvf yaourt.tar.gz | |
cd yaourt | |
makepkg -si --asroot --noconfirm | |
fi | |
check_install yaourt | |
# tar version 1.27 has a bug that prevents docker from commiting | |
# downgrade it to 1.26 | |
if [[ `pacman -Q tar` == "tar 1.27-1" ]]; then | |
wget http://seblu.net/a/arm/2013/09/11/core/os/x86_64/tar-1.26-4-x86_64.pkg.tar.xz | |
pacman --noconfirm -U tar-1.26-4-x86_64.pkg.tar.xz | |
rm tar-1.26-4-x86_64.pkg.tar.xz | |
fi | |
if [ ! `which docker` ]; then | |
yaourt -S -q --noconfirm lxc-docker-git | |
fi | |
check_install docker | |
# enable ipv4 forwarding | |
sysctl net.ipv4.ip_forward=1 | |
# start docker | |
systemctl start docker | |
# start on boot | |
systemctl enable docker | |
if [ ! `which pluginhook` ]; then | |
cd ~ && test -d pluginhook || git clone $PLUGINHOOK_REPO | |
cd ~/pluginhook | |
export GOPATH=~/pluginhook | |
go get code.google.com/p/go.crypto/ssh/terminal | |
make pluginhook | |
cp pluginhook.linux /usr/local/bin/pluginhook | |
fi | |
check_install pluginhook | |
if [ ! `which dokku` ]; then | |
cd ~ && test -d dokku || git clone $DOKKU_REPO | |
cd ~/dokku | |
fi | |
check_install dokku |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment