dotfiles

config files and scripts at HOME.
git clone git://git.ricketyspace.net/dotfiles.git
Log | Files | Refs

commit 773a5ba6aad88dc7ced8363a36c5a3cd8801f62d
parent f7ca2e2cca0b0d2fd1a747e9a547cce94c698c20
Author: rsiddharth <s@ricketyspace.net>
Date:   Tue, 18 Apr 2017 23:16:20 +0000

Add .containers/php5

Diffstat:
.containers/php5 | 42++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+), 0 deletions(-)

diff --git a/.containers/php5 b/.containers/php5 @@ -0,0 +1,42 @@ +#!/bin/sh +# +# Copyright © 2017 rsiddharth <s@ricketyspace.net> +# License: GNU General Public License version 3 or higher. +# +# systemd-nspawn container for php5 + +PWD=`pwd` +CONTAINER_DIR="boxes" +CONTAINER_NAME="php5" +CONTAINER=$CONTAINER_DIR'/'$CONTAINER_NAME +SCRIPT=`basename "$0"` + +if [ -n "$2" ]; then + BIND_DIR=$2 +else + BIND_DIR=$HOME +fi + +if [ "$1" = "bootstrap" ]; then + echo 'debootstrap' + sudo debootstrap --arch=amd64 jessie $CONTAINER + sudo systemd-nspawn -D ./$CONTAINER \ + --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ + /root/$SCRIPT install +elif [ "$1" = "install" ]; then + # this is run inside the container + apt-get update -y && \ + apt-get install -y php5 ca-certificates curl && + curl -sS https://getcomposer.org/installer | \ + php -- --install-dir=/usr/local/bin --filename=composer +elif [ "$1" = "start" ]; then + # start the container + sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ + --bind=$BIND_DIR:/root/bd \ + -D ./$CONTAINER \ + --bind-ro=/usr/share/terminfo/r/rxvt-256color:/root/.terminfo/r/rxvt-256color +else + echo 'Dunno what to do' + exit 1 +fi +