This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
forked from DevinciHQ/universal-docker-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Debian/Ubuntu and Mac OSX and improved setup steps
- Loading branch information
Ahmed Sghaier
committed
Mar 31, 2016
1 parent
c59cde6
commit aac1a35
Showing
4 changed files
with
279 additions
and
22 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,85 @@ | ||
ahoyapi: v1 | ||
version: 0.0.0 | ||
commands: | ||
|
||
setup: | ||
usage: Setup the Arch Linux development environment | ||
cmd: | | ||
set -e | ||
ahoy arch deps | ||
ahoy arch virtualbox | ||
ahoy arch docker | ||
ahoy arch nfs | ||
ahoy arch deps | ||
ahoy arch machine | ||
deps: | ||
usage: Install dependencies | ||
cmd: | | ||
echo; echo "*** Dependencies Setup ***"; echo | ||
set -e | ||
echo "*** Setting up perl-digest-hmac..." | ||
yaourt -S perl-digest-hmac | ||
virtualbox: | ||
usage: Install Virtualbox | ||
cmd: | | ||
echo; echo "*** Virtualbox Setup ***"; echo | ||
set -e | ||
echo "*** Virtualbox setup..." | ||
yaourt -S virtualbox virtualbox-guest-dkms virtualbox-guest-iso virtualbox-guest-utils virtualbox-host-dkms | ||
echo "*** Virtualbox drivers setup..." | ||
sudo /sbin/rcvboxdrv setup | ||
echo "*** Virtualbox kernel modules loading at system bootup..." | ||
sudo sh -c "echo -e \"vboxnetadp\nvboxnetflt\nvboxpci\nvboxdrv\" > /etc/modules-load.d/virtualbox.conf" | ||
docker: | ||
usage: Install Docker | ||
cmd: | | ||
echo; echo "*** Docker Setup ***"; echo | ||
set -e | ||
echo "*** Docker, docker-compose and docker-machine setup..." | ||
yaourt -S docker docker-compose docker-machine | ||
nfs: | ||
usage: Install NFS | ||
cmd: | | ||
echo; echo "*** NFS Setup ***"; echo | ||
set -e | ||
echo "*** Docker-machine-nfs setup..." | ||
sudo wget -q https://raw.githubusercontent.com/asghaier/docker-machine-nfs/arch-linux-support/docker-machine-nfs.sh -O /usr/local/bin/docker-machine-nfs && sudo chmod 755 /usr/local/bin/docker-machine-nfs | ||
echo "*** NTP and NFS-utils setup..." | ||
yaourt -S ntp nfs-utils | ||
echo "*** Starting and enabling bootup services for NTP daemon and NFS server..." | ||
sudo systemctl start ntpd.service | ||
sudo systemctl enable ntpd.service | ||
sudo systemctl start nfs-server.service | ||
sudo systemctl enable nfs-server.service | ||
deps: | ||
usage: Install dependencies | ||
cmd: | | ||
yaourt -S perl-digest-hmac | ||
machine: | ||
usage: Create the "default" Docker machine | ||
cmd: | | ||
echo; echo "*** Default Docker Machine Setup ***"; echo | ||
set -e | ||
MACHINE_NAME=default | ||
SHARE_FOLDER=$HOME/docker | ||
RC_FILE=$HOME/.zshrc | ||
echo "*** Creating the default docker machine using the virtualbox driver..." | ||
docker-machine create --driver virtualbox $MACHINE_NAME | ||
docker-machine-nfs $MACHINE_NAME --nfs-config="(rw,sync,all_squash,anonuid=$(id -u),anongid=$(id -g),no_subtree_check)" --shared-folder=$SHARE_FOLDER --force | ||
echo "*** Setting up docker machine nfs for the default machine..." | ||
docker-machine-nfs $MACHINE_NAME --nfs-config="(rw,sync,all_squash,anonuid=$(id -u),anongid=$(id -g),no_subtree_check)" --shared-folder=$HOME/docker --force | ||
echo "*** Environment variables setup and sourcing for the default machine..." | ||
DEFAULT_SOURCE="$HOME/.default.docker-machine" | ||
docker-machine env $MACHINE_NAME | grep -v "^#" > $DEFAULT_SOURCE | ||
source $DEFAULT_SOURCE | ||
echo "source $DEFAULT_SOURCE" >> $RC_FILE | ||
echo "source $DEFAULT_SOURCE" >> $(ahoy rcfile) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
ahoyapi: v1 | ||
version: 0.0.0 | ||
commands: | ||
|
||
setup: | ||
usage: Setup the Arch Linux development environment | ||
cmd: | | ||
set -e | ||
ahoy arch deps | ||
ahoy arch virtualbox | ||
ahoy arch docker | ||
ahoy arch nfs | ||
ahoy arch machine | ||
deps: | ||
usage: Install dependencies | ||
cmd: | | ||
echo; echo "*** Dependencies Setup ***"; echo | ||
set -e | ||
echo "*** Installing Perl digest hmac..." | ||
sudo apt-get install libdigest-hmac-perl -y | ||
virtualbox: | ||
usage: Install Virtualbox | ||
cmd: | | ||
echo; echo "*** Virtualbox Setup ***"; echo | ||
set -e | ||
echo "*** Adding virtualbox to apt sources..." | ||
echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release --codename -s) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list > /dev/null && wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - && sudo apt-get update | ||
echo "*** Virtualbox setup..." | ||
sudo apt-get install virtualbox-5.0 | ||
docker: | ||
usage: Install Docker | ||
cmd: | | ||
echo; echo "*** Docker Setup ***"; echo | ||
set -e | ||
MACHINE_MD5_LINUX_64=5558e5d7d003d337eacdc534c505dc5d | ||
COMPOSE_MD5_LINUX_64=cb7f2d7f1a45bcff83cfd4669b1dcf53 | ||
DOCKER_MD5_LINUX_64=4583697764e695dd6d7f68d2834b5443 | ||
echo "*** Adding docker to apt sources..." | ||
sudo apt-get install apt-transport-https ca-certificates && sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && echo "deb https://apt.dockerproject.org/repo ubuntu-${OS[$codename]} main" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && sudo apt-get update | ||
echo "*** Remove legacy lxc-docker if it exists..." | ||
sudo apt-get purge lxc-docker | ||
echo "*** Install linux-image-extra..." | ||
sudo apt-get install linux-image-extra-$(uname -r) | ||
if [ $(cat /etc/*release|grep -i 'ubuntu'|wc -l) -gt 0 ]; then | ||
echo "*** Install apparmor on Ubunu..." | ||
sudo apt-get install apparmor | ||
fi | ||
echo "*** Installing docker-engine..." | ||
echo $DOCKER_MD5_LINUX_64 /usr/bin/docker | md5sum -c - || sudo apt-get install docker-engine && echo $DOCKER_MD5_LINUX_64 /usr/bin/docker | md5sum -c - | ||
echo "*** Installing docker-machine..." | ||
echo $MACHINE_MD5_LINUX_64 /usr/local/bin/docker-machine | md5sum -c - || sudo wget -q https://github.com/docker/machine/releases/download/v0.6.0/docker-machine-`uname -s`-`uname -m` -O /usr/local/bin/docker-machine && sudo chmod 755 /usr/local/bin/docker-machine && echo $MACHINE_MD5_LINUX_64 /usr/local/bin/docker-machine | md5sum -c - | ||
echo "*** Installing docker-compose..." | ||
echo $COMPOSE_MD5_LINUX_64 /usr/local/bin/docker-compose | md5sum -c - || sudo wget -q https://github.com/docker/compose/releases/download/1.6.0/docker-compose-`uname -s`-`uname -m` -O /usr/local/bin/docker-compose && sudo chmod 755 /usr/local/bin/docker-compose && echo $COMPOSE_MD5_LINUX_64 /usr/local/bin/docker-compose | md5sum -c - | ||
nfs: | ||
usage: Install NFS | ||
cmd: | | ||
echo; echo "*** NFS Setup ***"; echo | ||
set -e | ||
# Note that we needed to modify the docker-machine-nfs script to work with linux. So load the custom version. | ||
# See https://github.com/adlogix/docker-machine-nfs/pull/51 | ||
echo "*** Installing docker-machine-nfs (custom version)..." | ||
sudo wget -q https://raw.githubusercontent.com/devinci-code/docker-machine-nfs/dev-50-support-linux/docker-machine-nfs.sh -O /usr/local/bin/docker-machine-nfs && sudo chmod 755 /usr/local/bin/docker-machine-nfs | ||
machine: | ||
usage: Create the "default" Docker machine | ||
cmd: | | ||
echo; echo "*** Default Docker Machine Setup ***"; echo | ||
set -e | ||
MACHINE_NAME=default | ||
echo "*** Creating a default docker-machine..." | ||
docker-machine create --driver virtualbox $MACHINE_NAME | ||
echo "*** Setting up the default docker-machine with NFS..." | ||
docker-machine-nfs $MACHINE_NAME --nfs-config="(rw,sync,all_squash,anonuid=$(id -u),anongid=$(id -g),no_subtree_check)" --shared-folder=$HOME/docker --force | ||
echo "*** Environment variables setup and sourcing for the default machine..." | ||
DEFAULT_SOURCE="$HOME/.default.docker-machine" | ||
docker-machine env $MACHINE_NAME | grep -v "^#" > $DEFAULT_SOURCE | ||
source $DEFAULT_SOURCE | ||
echo "source $DEFAULT_SOURCE" >> $(ahoy rcfile) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
ahoyapi: v1 | ||
version: 0.0.0 | ||
commands: | ||
|
||
setup: | ||
usage: Setup the Arch Linux development environment | ||
cmd: | | ||
set -e | ||
ahoy arch deps | ||
ahoy arch virtualbox | ||
ahoy arch docker | ||
ahoy arch nfs | ||
ahoy arch machine | ||
deps: | ||
usage: Install dependencies | ||
cmd: | | ||
echo; echo "*** Dependencies Setup ***"; echo | ||
set -e | ||
# Assume homebrew is a requirement for now | ||
if [ ! "$(which brew)" ]; then | ||
echo "[Error] It looks like homebrew isn't installed. Please install that first." | ||
exit 1 | ||
fi | ||
echo "*** Updating Homebrew..." | ||
brew update | ||
if [ -z "$(brew cask update)" ]; then | ||
echo "[Error] It looks like homebrew cask isn't installed. As of Dec 2015, it should come with homebrew. Try 'brew update'" | ||
fi | ||
virtualbox: | ||
usage: Install Virtualbox | ||
cmd: | | ||
echo; echo "*** Virtualbox Setup ***"; echo | ||
set -e | ||
echo "Installing the latest virtualbox" | ||
brew update | ||
docker: | ||
usage: Install Docker | ||
cmd: | | ||
echo; echo "*** Docker Setup ***"; echo | ||
set -e | ||
echo "*** Installing docker-engine..." | ||
brew install docker | ||
echo "*** Installing docker-machine..." | ||
brew install docker-machine | ||
echo "*** Installing docker-machine..." | ||
brew install docker-machine | ||
nfs: | ||
usage: Install NFS | ||
cmd: | | ||
echo; echo "*** NFS Setup ***"; echo | ||
set -e | ||
echo "*** Installing docker-machine-nfs..." | ||
curl -s https://raw.githubusercontent.com/adlogix/docker-machine-nfs/master/docker-machine-nfs.sh | sudo tee /usr/local/bin/docker-machine-nfs > /dev/null && sudo chmod +x /usr/local/bin/docker-machine-nfs | ||
machine: | ||
usage: Create the "default" Docker machine | ||
cmd: | | ||
echo; echo "*** Default Docker Machine Setup ***"; echo | ||
set -e | ||
MACHINE_NAME=default | ||
echo "*** Creating a default docker-machine..." | ||
docker-machine create --driver virtualbox $MACHINE_NAME | ||
echo "*** Setting up the default docker-machine with NFS..." | ||
docker-machine-nfs $MACHINE_NAME | ||
echo "*** Starting docker-machine $MACHINE_NAME..." | ||
docker-machine start $MACHINE_NAME | ||
echo "*** Environment variables setup and sourcing for the default machine..." | ||
DEFAULT_SOURCE="$HOME/.default.docker-machine" | ||
docker-machine env $MACHINE_NAME | grep -v "^#" > $DEFAULT_SOURCE | ||
source $DEFAULT_SOURCE | ||
echo "source $DEFAULT_SOURCE" >> $(ahoy rcfile) |