Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

add arch support to installer #90

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 70 additions & 1 deletion bin/dsh
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,15 @@ install_prerequisites ()
bash <(echo "$presetup_script")
read -p "Press any key when the installation in another console window is done..."
elif is_linux ; then
install_ubuntu
if lsb_release -a | grep -q Manjaro; then
#install arch for arch-systems
install_arch

else # Ubuntu
install_ubuntu

fi

else # mac
local presetup_script=$(curl -fsS https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/$B2D_BRANCH/scripts/presetup-mac.sh)
if_failed "Could not get 'presetup-mac.sh'. Please check your internet connection"
Expand Down Expand Up @@ -665,6 +673,67 @@ EOF
echo-green "To run docker without sudo log out and back in or run 'newgrp docker' now."
}

# Install Docker and setup Drude on Arch
install_arch ()
{
#if [ -r /etc/lsb-release ]; then
# lsb_dist="$(. /etc/lsb-release && echo "$DISTRIB_ID")"
# lsb_release="$(. /etc/lsb-release && echo "$DISTRIB_RELEASE")"
#fi

#if [[ $lsb_dist != 'Ubuntu' || $(_get_version_str $lsb_release) < $(_get_version_str '14.04') ]]; then
# echo-red "Sorry, this script only supports Ubuntu 14.04+"
# exit 1
#fi

echo-green "Installing Docker..."
sudo pacman -S docker --noconfirm && \
sudo systemctl start docker && \
sudo docker version
if_failed "Docker installation/upgrade failed."

echo-green "Installing Docker Compose..."
sudo pacman -S docker-compose && \
docker-compose --version
if_failed "Docker Compose installation/upgrade failed."

echo-green "Adding a subnet for Drude..."
ip_mask="192.168.10.1/24"
# Make sure we don't do this twice
if ! grep -q $ip_mask /etc/systemd/network/interfaces; then
cat > /tmp/drude.ip.addr <<EOF
up ip addr add 192.168.10.1/24 dev lo label lo:drude
down ip addr del 192.168.10.1/24 dev lo label lo:drude
EOF
sudo sed -i '/iface lo inet loopback/r /tmp/drude.ip.addr' /etc/systemd/network/interfaces
rm -f /tmp/drude.ip.addr
sudo ifconfig lo down && sudo ifconfig lo up
if_failed "Docker subnet configuration failed failed."
fi

echo-green "Creating Drude HTTP/HTTPS reverse proxy..."
sudo docker rm -f vhost-proxy || true
sudo docker run -d --name vhost-proxy -p 192.168.10.10:80:80 -p 192.168.10.10:443:443 --restart=always \
-v /var/run/docker.sock:/tmp/docker.sock blinkreaction/nginx-proxy:stable
if_failed "Drude HTTP/HTTPS reverse proxy setup failed."

echo-green "Creating Drude DNS service..."
sudo docker rm -f dns || true
sudo docker run -d --name dns -p 192.168.10.10:53:53/udp --cap-add=NET_ADMIN --dns 8.8.8.8 --restart=always \
-v /var/run/docker.sock:/var/run/docker.sock blinkreaction/dns-discovery:stable
if [[ $? == 0 ]]; then
echo-green "Configuring host DNS resolver for .drude domain..."
echo -e "\n# .drude domain resolution\nnameserver 192.168.10.10" | sudo tee -a /etc/resolvconf/resolv.conf.d/head
sudo resolvconf -u
else
echo-red "Drude DNS service setup failed."
fi

echo-green "To run docker without sudo log out and back in or run 'newgrp docker' now."
}



# Install Vagrantfile and vagrant.yml required by boot2docker
install_boot2docker ()
{
Expand Down