From 8bba66dfa74675cf8bf66c840821e83780bd279c Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Fri, 8 Apr 2016 04:33:24 +0200 Subject: [PATCH] added docker sandbox, work in progress --- sandbox/Dockerfile | 10 ++++ sandbox/Makefile | 7 +++ sandbox/README.markdown | 9 ++++ sandbox/my_init | 9 ++++ sandbox/run.sh | 102 ++++++++++++++++++++++++++++++++++++++++ sandbox/sources.list | 4 ++ 6 files changed, 141 insertions(+) create mode 100644 sandbox/Dockerfile create mode 100644 sandbox/Makefile create mode 100644 sandbox/README.markdown create mode 100644 sandbox/my_init create mode 100644 sandbox/run.sh create mode 100644 sandbox/sources.list diff --git a/sandbox/Dockerfile b/sandbox/Dockerfile new file mode 100644 index 0000000..10a96e1 --- /dev/null +++ b/sandbox/Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:16.04 + +RUN echo "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d +ADD ./sources.list /etc/apt/sources.list +ADD ./run.sh /tmp/run.sh +RUN bash /tmp/run.sh && rm /tmp/run.sh +ADD ./my_init /usr/sbin/my_init +RUN chmod +x /usr/sbin/my_init +CMD /usr/sbin/my_init + diff --git a/sandbox/Makefile b/sandbox/Makefile new file mode 100644 index 0000000..d709aff --- /dev/null +++ b/sandbox/Makefile @@ -0,0 +1,7 @@ +default: build + +build: + docker build -t sneak/sandbox . + +push: build + docker push sneak/sandbox diff --git a/sandbox/README.markdown b/sandbox/README.markdown new file mode 100644 index 0000000..f3806f1 --- /dev/null +++ b/sandbox/README.markdown @@ -0,0 +1,9 @@ +# TODO + +* ctags / enhanced vim +* screenrc or byobu config +* customize PS1 +* more shells +* more editors (emacs) +* rbenv build versions +* LaTeX and fonts and whatnot diff --git a/sandbox/my_init b/sandbox/my_init new file mode 100644 index 0000000..2184b5a --- /dev/null +++ b/sandbox/my_init @@ -0,0 +1,9 @@ +#!/bin/bash + +export > /etc/environment +/usr/sbin/runsvdir-start & +sleep 1 +if [[ ! -e /var/log/syslog ]]; then + touch /var/log/syslog +fi +exec tail -qf /var/log/syslog /etc/service/*/log/*.log diff --git a/sandbox/run.sh b/sandbox/run.sh new file mode 100644 index 0000000..82b8f1a --- /dev/null +++ b/sandbox/run.sh @@ -0,0 +1,102 @@ +#!/bin/bash +export DEBIAN_FRONTEND=noninteractive + +PKGS=" + apt-utils + bind9-host + bonnie++ + build-essential + byobu + command-not-found + daemontools + debmirror + docker + fortune + git + irssi + jq + ldap-auth-client + ldap-utils + lsof + libxml2 + libxml2-dev + mailutils + make + mosh + mutt + nmap + nodejs + npm + nscd + pbzip2 + pv + pwgen + python + python-dev + python-pip + rbenv + rsync + rsyslog + rsyslog-gnutls + rsyslog-relp + runit + screen + snmp + snmp-mibs-downloader + snmpd + telnet + texlive-latex-base + tmux + vagrant + vim + wamerican-insane + wget +" + +apt-get update +apt-get -y upgrade +apt-get install -y $PKGS + +# use faster one: +OLD="$(which bzip2)" +rm $OLD +ln $(which pbzip2) $OLD + +git clone https://github.com/rbenv/ruby-build.git /root/.rbenv/plugins/ruby-build + +cd /usr/local/bin +wget https://raw.githubusercontent.com/sneak/ppss/master/ppss +chmod +x ./ppss + +NPM_PKGS=" + coffee-script + coffeelint +" + +# update npm +npm update -g --loglevel info npm +for PKG in $NPM_PKGS ; do + npm install -g --loglevel info $PKG +done + +PIP_PKGS=" + virtualenv + pylint + awscli +" + +pip install --upgrade pip +pip install setuptools +pip install pip-review +pip-review --verbose --auto +for PKG in $PIP_PKGS; do + pip install $PKG +done + +# cleanup + +rm -rf \ + /root/.cache \ + /var/cache/* \ + /var/lib/apt/lists/* \ + /core diff --git a/sandbox/sources.list b/sandbox/sources.list new file mode 100644 index 0000000..df8ab5e --- /dev/null +++ b/sandbox/sources.list @@ -0,0 +1,4 @@ +deb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted universe multiverse +deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main restricted universe multiverse +deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-backports main restricted universe multiverse +deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-security main restricted universe multiverse