├── .gitignore ├── apache ├── setup │ ├── .gitignore │ ├── apt_setproxy │ ├── apps │ │ ├── www │ │ │ ├── default │ │ │ │ ├── images │ │ │ │ │ ├── dust.png │ │ │ │ │ └── chaplogo-150627.svg │ │ │ │ └── process_list.shtml │ │ │ └── sites.d │ │ │ │ └── default.conf │ │ ├── etc │ │ │ ├── skel │ │ │ │ ├── help │ │ │ │ │ ├── LAUNCHER.tpl │ │ │ │ │ └── HELP.tpl │ │ │ │ └── launcher │ │ │ │ │ └── run-IMAGE.sh.tpl │ │ │ └── ssleay.cnf │ │ ├── startup.d │ │ │ └── 150-ssl-setup.sh │ │ └── chaperone.d │ │ │ ├── 005-config.conf │ │ │ └── 120-apache2.conf │ └── install.sh ├── Makefile ├── Dockerfile.tpl └── tests │ ├── main-apache.elt │ └── tasks-apache.elt ├── lamp ├── setup │ ├── .gitignore │ ├── apt_setproxy │ └── apps │ │ ├── www │ │ ├── default │ │ │ ├── do_phpinfo.php │ │ │ ├── images │ │ │ │ ├── dust.png │ │ │ │ └── chaplogo-150627.svg │ │ │ └── process_list.php │ │ └── sites.d │ │ │ └── default.conf │ │ ├── etc │ │ ├── ssleay.cnf │ │ ├── skel │ │ │ ├── clone │ │ │ │ └── run.sh.tpl │ │ │ ├── help │ │ │ │ ├── LAUNCHER.tpl │ │ │ │ └── HELP.tpl │ │ │ └── launcher │ │ │ │ └── run-IMAGE.sh.tpl │ │ └── mysql │ │ │ └── start_mysql.sh │ │ ├── startup.d │ │ ├── 150-ssl-setup.sh │ │ ├── phpmyadmin.sh │ │ └── mysql.sh │ │ └── chaperone.d │ │ ├── 105-mysqld.conf │ │ ├── 005-config.conf │ │ └── 120-apache2.conf ├── Makefile ├── Dockerfile.tpl └── tests │ ├── tasks-lamp.elt │ └── main-lamp.elt ├── lemp ├── setup │ ├── .gitignore │ ├── apt_setproxy │ ├── apps │ │ ├── www │ │ │ ├── default │ │ │ └── sites.d │ │ │ │ └── php-fast.inc.tpl │ │ ├── etc │ │ │ ├── php-cli.ini │ │ │ ├── ssleay.cnf │ │ │ ├── skel │ │ │ │ ├── clone │ │ │ │ │ └── run.sh.tpl │ │ │ │ ├── help │ │ │ │ │ ├── LAUNCHER.tpl │ │ │ │ │ └── HELP.tpl │ │ │ │ └── launcher │ │ │ │ │ └── run-IMAGE.sh.tpl │ │ │ ├── phpmyadmin-config.inc.php.tpl │ │ │ ├── mysql │ │ │ │ └── start_mysql.sh │ │ │ ├── start_nginx.sh │ │ │ └── nginx.conf.tpl │ │ ├── startup.d │ │ │ ├── phpmyadmin.sh │ │ │ ├── 150-ssl-setup.sh │ │ │ ├── nginx.sh │ │ │ └── mysql.sh │ │ └── chaperone.d │ │ │ ├── 105-mysqld.conf │ │ │ └── 005-config.conf │ └── nginx_signing.key ├── Makefile ├── Dockerfile.tpl └── tests │ ├── tasks-lemp.elt │ └── main-lemp.elt ├── alpinebase ├── setup │ ├── .gitignore │ ├── apps │ │ ├── bin │ │ ├── README │ │ ├── etc │ │ │ ├── skel │ │ │ ├── logrotate.conf │ │ │ ├── README │ │ │ └── startup.sh │ │ ├── startup.d │ │ └── chaperone.d │ ├── buildenv.inc │ ├── dot.bashrc │ └── create-binaries.sh ├── Makefile ├── Dockerfile.tpl └── tests │ ├── main-alpinebase.elt │ └── tasks-alpinebase.elt ├── baseimage ├── setup │ ├── .gitignore │ ├── buildenv.inc │ ├── apps │ │ ├── bin │ │ │ ├── tpl_envcp │ │ │ ├── cps │ │ │ ├── README │ │ │ ├── get-help │ │ │ ├── clone-apps │ │ │ ├── sample_app │ │ │ └── get-chaplocal │ │ ├── etc │ │ │ ├── logrotate.conf │ │ │ ├── skel │ │ │ │ ├── clone │ │ │ │ │ ├── Dockerfile.tpl │ │ │ │ │ ├── bash.bashrc.tpl │ │ │ │ │ ├── build │ │ │ │ │ │ ├── install.sh.tpl │ │ │ │ │ │ └── README.tpl │ │ │ │ │ └── build.sh.tpl │ │ │ │ ├── help │ │ │ │ │ ├── LAUNCHER.tpl │ │ │ │ │ └── HELP.tpl │ │ │ │ ├── shell_vars.inc │ │ │ │ └── launcher │ │ │ │ │ └── run-IMAGE.sh.tpl │ │ │ ├── README │ │ │ └── startup.sh │ │ ├── chaperone.d │ │ │ ├── 300-logrotate.conf │ │ │ ├── 005-config.conf │ │ │ └── 200-userapp.conf │ │ ├── startup.d │ │ │ └── README │ │ └── README │ ├── apt_setproxy │ ├── dot.bashrc │ └── create-binaries.sh ├── Makefile ├── Dockerfile.tpl └── tests │ ├── main-baseimage.elt │ ├── tasks-baseimage.elt │ └── inetd-baseimage.elt ├── centosbase ├── setup │ ├── .gitignore │ ├── apps │ ├── buildenv.inc │ ├── dot.bashrc │ └── create-binaries.sh ├── Makefile ├── Dockerfile.tpl └── tests │ ├── main-centosbase.elt │ ├── tasks-centosbase.elt │ └── inetd-centosbase.elt ├── nginx-django ├── setup │ ├── .gitignore │ ├── apps │ │ ├── etc │ │ ├── www │ │ ├── startup.d │ │ └── chaperone.d │ │ │ ├── 005-config.conf │ │ │ └── 130-nginx.conf │ ├── apt_setproxy │ ├── install.sh │ └── create-binaries.sh ├── Dockerfile.tpl ├── Makefile └── tests │ ├── main-np.elt │ └── tasks-np.elt ├── alpine-nginx-django ├── setup │ ├── apps │ │ ├── www │ │ │ ├── django_sample │ │ │ │ ├── mysite │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── wsgi.py │ │ │ │ │ └── urls.py │ │ │ │ ├── polls │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── migrations │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── 0001_initial.py │ │ │ │ │ ├── tests.py │ │ │ │ │ ├── apps.py │ │ │ │ │ ├── admin.py │ │ │ │ │ ├── templates │ │ │ │ │ │ └── polls │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ ├── results.html │ │ │ │ │ │ │ └── detail.html │ │ │ │ │ ├── urls.py │ │ │ │ │ ├── models.py │ │ │ │ │ └── views.py │ │ │ │ ├── chapinfo │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── migrations │ │ │ │ │ │ └── __init__.py │ │ │ │ │ ├── models.py │ │ │ │ │ ├── tests.py │ │ │ │ │ ├── admin.py │ │ │ │ │ ├── apps.py │ │ │ │ │ ├── static │ │ │ │ │ │ └── chapinfo │ │ │ │ │ │ │ └── images │ │ │ │ │ │ │ ├── dust.png │ │ │ │ │ │ │ ├── django_admin.png │ │ │ │ │ │ │ └── chaplogo-150627.svg │ │ │ │ │ ├── urls.py │ │ │ │ │ ├── templates │ │ │ │ │ │ └── chapinfo │ │ │ │ │ │ │ └── process_list.html │ │ │ │ │ └── views.py │ │ │ │ ├── static │ │ │ │ │ ├── admin │ │ │ │ │ │ ├── fonts │ │ │ │ │ │ │ ├── README.txt │ │ │ │ │ │ │ ├── Roboto-Bold-webfont.woff │ │ │ │ │ │ │ ├── Roboto-Light-webfont.woff │ │ │ │ │ │ │ └── Roboto-Regular-webfont.woff │ │ │ │ │ │ ├── img │ │ │ │ │ │ │ ├── tooltag-arrowright.svg │ │ │ │ │ │ │ ├── README.txt │ │ │ │ │ │ │ ├── icon-addlink.svg │ │ │ │ │ │ │ ├── tooltag-add.svg │ │ │ │ │ │ │ ├── icon-changelink.svg │ │ │ │ │ │ │ ├── icon-deletelink.svg │ │ │ │ │ │ │ ├── icon-yes.svg │ │ │ │ │ │ │ ├── search.svg │ │ │ │ │ │ │ ├── icon-alert.svg │ │ │ │ │ │ │ ├── icon-no.svg │ │ │ │ │ │ │ ├── inline-delete.svg │ │ │ │ │ │ │ ├── icon-unknown-alt.svg │ │ │ │ │ │ │ ├── icon-unknown.svg │ │ │ │ │ │ │ ├── icon-clock.svg │ │ │ │ │ │ │ ├── gis │ │ │ │ │ │ │ │ ├── move_vertex_off.svg │ │ │ │ │ │ │ │ └── move_vertex_on.svg │ │ │ │ │ │ │ ├── icon-calendar.svg │ │ │ │ │ │ │ ├── calendar-icons.svg │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ └── sorting-icons.svg │ │ │ │ │ │ ├── js │ │ │ │ │ │ │ ├── prepopulate.min.js │ │ │ │ │ │ │ ├── jquery.init.js │ │ │ │ │ │ │ ├── collapse.min.js │ │ │ │ │ │ │ ├── vendor │ │ │ │ │ │ │ │ ├── xregexp │ │ │ │ │ │ │ │ │ └── LICENSE-XREGEXP.txt │ │ │ │ │ │ │ │ └── jquery │ │ │ │ │ │ │ │ │ └── LICENSE-JQUERY.txt │ │ │ │ │ │ │ ├── collapse.js │ │ │ │ │ │ │ └── prepopulate.js │ │ │ │ │ │ └── css │ │ │ │ │ │ │ ├── fonts.css │ │ │ │ │ │ │ ├── dashboard.css │ │ │ │ │ │ │ └── login.css │ │ │ │ │ └── chapinfo │ │ │ │ │ │ └── images │ │ │ │ │ │ ├── dust.png │ │ │ │ │ │ ├── django_admin.png │ │ │ │ │ │ └── chaplogo-150627.svg │ │ │ │ └── manage.py │ │ │ ├── uwsgi.d │ │ │ │ └── django_sample.ini │ │ │ └── sites.d │ │ │ │ ├── uwsgi.inc │ │ │ │ └── uwsgi.inc.tpl │ │ ├── etc │ │ │ ├── ssleay.cnf │ │ │ ├── nginx.conf.tpl │ │ │ ├── start_nginx.sh │ │ │ └── skel │ │ │ │ ├── clone │ │ │ │ ├── run.sh.tpl │ │ │ │ └── build │ │ │ │ │ └── install.sh.tpl │ │ │ │ ├── help │ │ │ │ ├── LAUNCHER.tpl │ │ │ │ └── HELP.tpl │ │ │ │ └── launcher │ │ │ │ └── run-IMAGE.sh.tpl │ │ ├── startup.d │ │ │ ├── nginx.sh │ │ │ ├── 150-ssl-setup.sh │ │ │ └── 210-django-setup.sh │ │ └── chaperone.d │ │ │ ├── 005-config.conf │ │ │ └── 130-nginx.conf │ └── install.sh ├── Makefile ├── Dockerfile.tpl └── tests │ ├── main-np.elt │ └── tasks-np.elt ├── alpine-nginx-php ├── setup │ ├── apps │ │ ├── www │ │ │ ├── default │ │ │ │ ├── do_phpinfo.php │ │ │ │ ├── images │ │ │ │ │ ├── dust.png │ │ │ │ │ └── chaplogo-150627.svg │ │ │ │ └── process_list.php │ │ │ └── sites.d │ │ │ │ └── php-fast.inc.tpl │ │ ├── etc │ │ │ ├── php-cli.ini │ │ │ ├── ssleay.cnf │ │ │ ├── skel │ │ │ │ ├── clone │ │ │ │ │ ├── run.sh.tpl │ │ │ │ │ └── build │ │ │ │ │ │ └── install.sh.tpl │ │ │ │ ├── help │ │ │ │ │ ├── LAUNCHER.tpl │ │ │ │ │ └── HELP.tpl │ │ │ │ └── launcher │ │ │ │ │ └── run-IMAGE.sh.tpl │ │ │ ├── start_nginx.sh │ │ │ └── nginx.conf.tpl │ │ ├── startup.d │ │ │ ├── 150-ssl-setup.sh │ │ │ └── nginx.sh │ │ └── chaperone.d │ │ │ ├── 005-config.conf │ │ │ └── 130-nginx.conf │ └── install.sh ├── Makefile ├── Dockerfile.tpl └── tests │ ├── main-np.elt │ └── tasks-np.elt ├── alpinejava ├── Makefile ├── setup │ └── apps │ │ ├── java_sample │ │ └── SampleApp.class │ │ ├── chaperone.d │ │ ├── 020-java.conf │ │ └── 200-userapp.conf │ │ └── etc │ │ └── skel │ │ └── help │ │ └── HELP.tpl ├── Dockerfile.tpl └── tests │ ├── main-alpinejava.elt │ └── tasks-alpinejava.elt ├── include ├── version.inc ├── general.elt ├── buildenv.inc └── make.inc ├── bin ├── expect-lite-run ├── expect-lite-command-run ├── expect-test-image ├── expect-test-command └── test-driver ├── LICENSE └── Makefile /.gitignore: -------------------------------------------------------------------------------- 1 | test_logs 2 | -------------------------------------------------------------------------------- /apache/setup/.gitignore: -------------------------------------------------------------------------------- 1 | bin/* 2 | 3 | -------------------------------------------------------------------------------- /lamp/setup/.gitignore: -------------------------------------------------------------------------------- 1 | bin/* 2 | 3 | -------------------------------------------------------------------------------- /lemp/setup/.gitignore: -------------------------------------------------------------------------------- 1 | bin/* 2 | 3 | -------------------------------------------------------------------------------- /alpinebase/setup/.gitignore: -------------------------------------------------------------------------------- 1 | lib/* 2 | 3 | -------------------------------------------------------------------------------- /baseimage/setup/.gitignore: -------------------------------------------------------------------------------- 1 | lib/* 2 | 3 | -------------------------------------------------------------------------------- /centosbase/setup/.gitignore: -------------------------------------------------------------------------------- 1 | lib/* 2 | 3 | -------------------------------------------------------------------------------- /nginx-django/setup/.gitignore: -------------------------------------------------------------------------------- 1 | lib/* 2 | -------------------------------------------------------------------------------- /centosbase/setup/apps: -------------------------------------------------------------------------------- 1 | ../../baseimage/setup/apps -------------------------------------------------------------------------------- /alpinebase/setup/apps/bin: -------------------------------------------------------------------------------- 1 | ../../../baseimage/setup/apps/bin -------------------------------------------------------------------------------- /alpinebase/setup/buildenv.inc: -------------------------------------------------------------------------------- 1 | ../../include/buildenv.inc -------------------------------------------------------------------------------- /baseimage/setup/buildenv.inc: -------------------------------------------------------------------------------- 1 | ../../include/buildenv.inc -------------------------------------------------------------------------------- /centosbase/setup/buildenv.inc: -------------------------------------------------------------------------------- 1 | ../../include/buildenv.inc -------------------------------------------------------------------------------- /lamp/setup/apt_setproxy: -------------------------------------------------------------------------------- 1 | ../../baseimage/setup/apt_setproxy -------------------------------------------------------------------------------- /lemp/setup/apt_setproxy: -------------------------------------------------------------------------------- 1 | ../../baseimage/setup/apt_setproxy -------------------------------------------------------------------------------- /apache/setup/apt_setproxy: -------------------------------------------------------------------------------- 1 | ../../baseimage/setup/apt_setproxy -------------------------------------------------------------------------------- /centosbase/setup/dot.bashrc: -------------------------------------------------------------------------------- 1 | ../../baseimage/setup/dot.bashrc -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/mysite/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /alpinebase/setup/apps/README: -------------------------------------------------------------------------------- 1 | ../../../baseimage/setup/apps/README -------------------------------------------------------------------------------- /lamp/setup/apps/www/default/do_phpinfo.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lemp/setup/apps/www/default: -------------------------------------------------------------------------------- 1 | ../../../../lamp/setup/apps/www/default -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /alpinebase/setup/apps/etc/skel: -------------------------------------------------------------------------------- 1 | ../../../../baseimage/setup/apps/etc/skel -------------------------------------------------------------------------------- /alpinebase/setup/apps/startup.d: -------------------------------------------------------------------------------- 1 | ../../../baseimage/setup/apps/startup.d -------------------------------------------------------------------------------- /nginx-django/setup/apps/etc: -------------------------------------------------------------------------------- 1 | ../../../alpine-nginx-django/setup/apps/etc -------------------------------------------------------------------------------- /nginx-django/setup/apps/www: -------------------------------------------------------------------------------- 1 | ../../../alpine-nginx-django/setup/apps/www -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/www/default/do_phpinfo.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /alpinebase/setup/apps/chaperone.d: -------------------------------------------------------------------------------- 1 | ../../../baseimage/setup/apps/chaperone.d -------------------------------------------------------------------------------- /lamp/setup/apps/etc/ssleay.cnf: -------------------------------------------------------------------------------- 1 | ../../../../apache/setup/apps/etc/ssleay.cnf -------------------------------------------------------------------------------- /lemp/setup/apps/etc/php-cli.ini: -------------------------------------------------------------------------------- 1 | ../../../../lamp/setup/apps/etc/php-cli.ini -------------------------------------------------------------------------------- /lemp/setup/apps/etc/ssleay.cnf: -------------------------------------------------------------------------------- 1 | ../../../../apache/setup/apps/etc/ssleay.cnf -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /nginx-django/setup/apps/startup.d: -------------------------------------------------------------------------------- 1 | ../../../alpine-nginx-django/setup/apps/startup.d -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/etc/php-cli.ini: -------------------------------------------------------------------------------- 1 | ../../../../lamp/setup/apps/etc/php-cli.ini -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/etc/ssleay.cnf: -------------------------------------------------------------------------------- 1 | ../../../../apache/setup/apps/etc/ssleay.cnf -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/etc/ssleay.cnf: -------------------------------------------------------------------------------- 1 | ../../../../apache/setup/apps/etc/ssleay.cnf -------------------------------------------------------------------------------- /alpinejava/Makefile: -------------------------------------------------------------------------------- 1 | BASENAME = chaperone-alpinejava 2 | 3 | include ../include/make.inc 4 | -------------------------------------------------------------------------------- /include/version.inc: -------------------------------------------------------------------------------- 1 | IMAGE_NAMESPACE=chapdev 2 | IMAGE_ARCH=U14 3 | IMAGE_VERSION=1.0.16 4 | -------------------------------------------------------------------------------- /lemp/setup/apps/startup.d/phpmyadmin.sh: -------------------------------------------------------------------------------- 1 | ../../../../lamp/setup/apps/startup.d/phpmyadmin.sh -------------------------------------------------------------------------------- /bin/expect-lite-run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exec docker run -i -t --rm $EL_TEST_IMAGE /bin/bash 4 | -------------------------------------------------------------------------------- /lamp/setup/apps/startup.d/150-ssl-setup.sh: -------------------------------------------------------------------------------- 1 | ../../../../apache/setup/apps/startup.d/150-ssl-setup.sh -------------------------------------------------------------------------------- /lemp/setup/apps/chaperone.d/105-mysqld.conf: -------------------------------------------------------------------------------- 1 | ../../../../lamp/setup/apps/chaperone.d/105-mysqld.conf -------------------------------------------------------------------------------- /lemp/setup/apps/startup.d/150-ssl-setup.sh: -------------------------------------------------------------------------------- 1 | ../../../../apache/setup/apps/startup.d/150-ssl-setup.sh -------------------------------------------------------------------------------- /lamp/setup/apps/etc/skel/clone/run.sh.tpl: -------------------------------------------------------------------------------- 1 | ../../../../../../apache/setup/apps/etc/skel/clone/run.sh.tpl -------------------------------------------------------------------------------- /lemp/setup/apps/etc/skel/clone/run.sh.tpl: -------------------------------------------------------------------------------- 1 | ../../../../../../apache/setup/apps/etc/skel/clone/run.sh.tpl -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/etc/nginx.conf.tpl: -------------------------------------------------------------------------------- 1 | ../../../../alpine-nginx-php/setup/apps/etc/nginx.conf.tpl -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/etc/start_nginx.sh: -------------------------------------------------------------------------------- 1 | ../../../../alpine-nginx-php/setup/apps/etc/start_nginx.sh -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/startup.d/nginx.sh: -------------------------------------------------------------------------------- 1 | ../../../../alpine-nginx-php/setup/apps/startup.d/nginx.sh -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/startup.d/150-ssl-setup.sh: -------------------------------------------------------------------------------- 1 | ../../../../apache/setup/apps/startup.d/150-ssl-setup.sh -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/startup.d/150-ssl-setup.sh: -------------------------------------------------------------------------------- 1 | ../../../../apache/setup/apps/startup.d/150-ssl-setup.sh -------------------------------------------------------------------------------- /lemp/setup/apps/etc/phpmyadmin-config.inc.php.tpl: -------------------------------------------------------------------------------- 1 | ../../../../lamp/setup/apps/etc/phpmyadmin-config.inc.php.tpl -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/etc/skel/clone/run.sh.tpl: -------------------------------------------------------------------------------- 1 | ../../../../../../apache/setup/apps/etc/skel/clone/run.sh.tpl -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/etc/skel/clone/run.sh.tpl: -------------------------------------------------------------------------------- 1 | ../../../../../../apache/setup/apps/etc/skel/clone/run.sh.tpl -------------------------------------------------------------------------------- /lamp/Makefile: -------------------------------------------------------------------------------- 1 | BASENAME = chaperone-lamp 2 | 3 | include ../include/make.inc 4 | 5 | clean: 6 | rm -rf `find . -name '*~'` 7 | -------------------------------------------------------------------------------- /lemp/Makefile: -------------------------------------------------------------------------------- 1 | BASENAME = chaperone-lemp 2 | 3 | include ../include/make.inc 4 | 5 | clean: 6 | rm -rf `find . -name '*~'` 7 | -------------------------------------------------------------------------------- /apache/Makefile: -------------------------------------------------------------------------------- 1 | BASENAME = chaperone-apache 2 | 3 | include ../include/make.inc 4 | 5 | clean: 6 | rm -rf `find . -name '*~'` 7 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /alpine-nginx-php/Makefile: -------------------------------------------------------------------------------- 1 | BASENAME = alpine-nginx-php 2 | 3 | include ../include/make.inc 4 | 5 | clean: 6 | rm -rf `find . -name '*~'` 7 | -------------------------------------------------------------------------------- /lamp/setup/apps/www/default/images/dust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garywiz/chaperone-docker/HEAD/lamp/setup/apps/www/default/images/dust.png -------------------------------------------------------------------------------- /apache/setup/apps/www/default/images/dust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garywiz/chaperone-docker/HEAD/apache/setup/apps/www/default/images/dust.png -------------------------------------------------------------------------------- /bin/expect-lite-command-run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function TASK() { docker run -i -t --rm $EL_TEST_IMAGE --task $1; } 4 | export -f TASK 5 | bash -i 6 | -------------------------------------------------------------------------------- /alpinejava/setup/apps/java_sample/SampleApp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garywiz/chaperone-docker/HEAD/alpinejava/setup/apps/java_sample/SampleApp.class -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class PollsConfig(AppConfig): 5 | name = 'polls' 6 | -------------------------------------------------------------------------------- /baseimage/setup/apps/bin/tpl_envcp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Standard options used for all default template expansions 3 | exec envcp --xprefix '%' --xgroup '(' --shell $* 4 | -------------------------------------------------------------------------------- /alpine-nginx-django/Makefile: -------------------------------------------------------------------------------- 1 | BASENAME = alpine-nginx-django 2 | 3 | include ../include/make.inc 4 | 5 | clean: 6 | rm -rf `find . -name '*~' -o -name '__pycache__'` 7 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/www/default/images/dust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garywiz/chaperone-docker/HEAD/alpine-nginx-php/setup/apps/www/default/images/dust.png -------------------------------------------------------------------------------- /baseimage/setup/apps/bin/cps: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # PS defaults which are a bit nicer for containers 3 | 4 | ps --forest -weo 'user,pid,ppid,pgid,vsz,rss,stat,command' $* 5 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ChapinfoConfig(AppConfig): 5 | name = 'chapinfo' 6 | -------------------------------------------------------------------------------- /bin/expect-test-image: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export EL_SHELL="expect-lite-run" 4 | export EL_include_dir="$TOPLEV_DIR/include" 5 | exec expect-lite timeout_multiplier=${EL_timeout_multiplier:-1} $1 6 | -------------------------------------------------------------------------------- /bin/expect-test-command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export EL_SHELL="expect-lite-command-run" 4 | export EL_include_dir="$TOPLEV_DIR/include" 5 | exec expect-lite timeout_multiplier=${EL_timeout_multiplier:-1} $1 6 | -------------------------------------------------------------------------------- /lamp/Dockerfile.tpl: -------------------------------------------------------------------------------- 1 | FROM chapdev/chaperone-baseimage:latest 2 | #MAINTAINER Gary Wisniewski 3 | 4 | ADD setup/ /setup-lamp/ 5 | RUN /setup-lamp/install.sh 6 | 7 | EXPOSE 8080 8443 8 | -------------------------------------------------------------------------------- /lemp/Dockerfile.tpl: -------------------------------------------------------------------------------- 1 | FROM chapdev/chaperone-baseimage:latest 2 | #MAINTAINER Gary Wisniewski 3 | 4 | ADD setup/ /setup-lemp/ 5 | RUN /setup-lemp/install.sh 6 | 7 | EXPOSE 8080 8443 8 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from .models import Question, Choice 4 | 5 | admin.site.register(Question) 6 | admin.site.register(Choice) 7 | -------------------------------------------------------------------------------- /apache/Dockerfile.tpl: -------------------------------------------------------------------------------- 1 | FROM chapdev/chaperone-baseimage:latest 2 | #MAINTAINER Gary Wisniewski 3 | 4 | ADD setup/ /setup-apache/ 5 | RUN /setup-apache/install.sh 6 | 7 | EXPOSE 8080 8443 8 | -------------------------------------------------------------------------------- /nginx-django/Dockerfile.tpl: -------------------------------------------------------------------------------- 1 | FROM chapdev/chaperone-baseimage:latest 2 | #MAINTAINER Gary Wisniewski 3 | 4 | ADD setup/ /setup-np/ 5 | RUN /setup-np/install.sh 6 | 7 | EXPOSE 8080 8443 8 | -------------------------------------------------------------------------------- /alpine-nginx-django/Dockerfile.tpl: -------------------------------------------------------------------------------- 1 | FROM chapdev/chaperone-alpinebase:latest 2 | #MAINTAINER Gary Wisniewski 3 | 4 | ADD setup/ /setup-np/ 5 | RUN /setup-np/install.sh 6 | 7 | EXPOSE 8080 8443 8 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/fonts/README.txt: -------------------------------------------------------------------------------- 1 | Roboto webfont source: https://www.google.com/fonts/specimen/Roboto 2 | Weights used in this project: Light (300), Regular (400), Bold (700) 3 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/chapinfo/images/dust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garywiz/chaperone-docker/HEAD/alpine-nginx-django/setup/apps/www/django_sample/static/chapinfo/images/dust.png -------------------------------------------------------------------------------- /alpine-nginx-php/Dockerfile.tpl: -------------------------------------------------------------------------------- 1 | FROM chapdev/chaperone-alpinebase:latest 2 | #MAINTAINER Gary Wisniewski 3 | 4 | ADD setup/ /setup-np/ 5 | RUN /setup-np/install.sh 6 | 7 | EXPOSE 8080 8443 8 | -------------------------------------------------------------------------------- /alpinebase/setup/apps/etc/logrotate.conf: -------------------------------------------------------------------------------- 1 | # logrotate will run in the $(VAR_DIR)/log directory by default. 2 | # So paths here needn't be absolute. 3 | 4 | "*.log" { 5 | rotate 5 6 | daily 7 | compress 8 | } 9 | -------------------------------------------------------------------------------- /baseimage/setup/apps/etc/logrotate.conf: -------------------------------------------------------------------------------- 1 | # logrotate will run in the $(VAR_DIR)/log directory by default. 2 | # So paths here needn't be absolute. 3 | 4 | "*.log" { 5 | rotate 5 6 | daily 7 | compress 8 | } 9 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/static/chapinfo/images/dust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garywiz/chaperone-docker/HEAD/alpine-nginx-django/setup/apps/www/django_sample/chapinfo/static/chapinfo/images/dust.png -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/chapinfo/images/django_admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garywiz/chaperone-docker/HEAD/alpine-nginx-django/setup/apps/www/django_sample/static/chapinfo/images/django_admin.png -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/fonts/Roboto-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garywiz/chaperone-docker/HEAD/alpine-nginx-django/setup/apps/www/django_sample/static/admin/fonts/Roboto-Bold-webfont.woff -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/fonts/Roboto-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garywiz/chaperone-docker/HEAD/alpine-nginx-django/setup/apps/www/django_sample/static/admin/fonts/Roboto-Light-webfont.woff -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/fonts/Roboto-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garywiz/chaperone-docker/HEAD/alpine-nginx-django/setup/apps/www/django_sample/static/admin/fonts/Roboto-Regular-webfont.woff -------------------------------------------------------------------------------- /alpinejava/Dockerfile.tpl: -------------------------------------------------------------------------------- 1 | FROM chapdev/chaperone-alpinebase:latest 2 | #MAINTAINER Gary Wisniewski 3 | 4 | ADD setup/ /setup-alpinejava/ 5 | RUN /setup-alpinejava/install.sh 6 | 7 | ENTRYPOINT ["/usr/local/bin/chaperone"] 8 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/static/chapinfo/images/django_admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garywiz/chaperone-docker/HEAD/alpine-nginx-django/setup/apps/www/django_sample/chapinfo/static/chapinfo/images/django_admin.png -------------------------------------------------------------------------------- /baseimage/setup/apps/etc/skel/clone/Dockerfile.tpl: -------------------------------------------------------------------------------- 1 | # This is a template Dockerfile for creating a new image. 2 | # See the README for a complete description of how you create derivative images. 3 | 4 | FROM %(PARENT_IMAGE) 5 | ADD . /setup/ 6 | RUN /setup/build/install.sh 7 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/uwsgi.d/django_sample.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | 3 | plugin = /usr/lib/uwsgi/python3 4 | 5 | chdir = $(APPS_DIR)/www/django_sample 6 | module = mysite.wsgi 7 | 8 | master = true 9 | processes = 3 10 | socket = /tmp/django_sample.sock 11 | vacuum = true 12 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url 2 | from django.views.generic import RedirectView 3 | 4 | from . import views 5 | 6 | app_name = 'chapinfo' 7 | urlpatterns = [ 8 | url(r'^(.+)$', views.generic, name='generic'), 9 | url(r'^$', RedirectView.as_view(url='/index.html')), 10 | ] 11 | -------------------------------------------------------------------------------- /alpinebase/Makefile: -------------------------------------------------------------------------------- 1 | BASENAME = chaperone-alpinebase 2 | 3 | include ../include/make.inc 4 | 5 | build: binaries 6 | 7 | rebuild: binaries 8 | 9 | binaries: setup/lib/setproctitle-install.tar.gz 10 | 11 | setup/lib/setproctitle-install.tar.gz: 12 | ./setup/create-binaries.sh 13 | 14 | clean: 15 | rm -rf ./setup/lib 16 | rm -rf `find . -name '*~'` 17 | -------------------------------------------------------------------------------- /alpinejava/setup/apps/chaperone.d/020-java.conf: -------------------------------------------------------------------------------- 1 | # 020-java.conf 2 | # 3 | # Java specifics. Not much here, but creates a good place to add customizations. 4 | 5 | settings: { 6 | env_set: { 7 | 8 | # Figure out java location when we start rather than hardcode it. 9 | JAVA_HOME: "`readlink -f $(which java) | sed 's|/bin/java$||'`" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/tooltag-arrowright.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /baseimage/setup/apps/etc/skel/help/LAUNCHER.tpl: -------------------------------------------------------------------------------- 1 | 2 | The %(DEFAULT_LAUNCHER) script is a quick-start for launching 3 | containers from the %(PARENT_IMAGE) image. 4 | 5 | To get this message again: 6 | docker run -i --rm %(PARENT_IMAGE) --task get-help LAUNCHER 7 | 8 | Or, for geeneral help on the image itself: 9 | docker run -i --rm %(PARENT_IMAGE) --task get-help 10 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/templates/polls/index.html: -------------------------------------------------------------------------------- 1 | {% if latest_question_list %} 2 | 7 | {% else %} 8 |

No polls are available.

9 | {% endif %} 10 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/templates/polls/results.html: -------------------------------------------------------------------------------- 1 |

{{ question.question_text }}

2 | 3 |
    4 | {% for choice in question.choice_set.all %} 5 |
  • {{ choice.choice_text }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }}
  • 6 | {% endfor %} 7 |
8 | 9 | Vote again? 10 | -------------------------------------------------------------------------------- /baseimage/Makefile: -------------------------------------------------------------------------------- 1 | BASENAME = chaperone-baseimage 2 | 3 | include ../include/make.inc 4 | 5 | .PHONY: binaries 6 | 7 | build: binaries 8 | 9 | rebuild: binaries 10 | 11 | binaries: setup/lib/setproctitle-install.tar.gz 12 | 13 | setup/lib/setproctitle-install.tar.gz: 14 | ./setup/create-binaries.sh 15 | 16 | clean: 17 | rm -rf ./setup/lib 18 | rm -rf `find . -name '*~'` 19 | -------------------------------------------------------------------------------- /centosbase/Makefile: -------------------------------------------------------------------------------- 1 | BASENAME = chaperone-centosbase 2 | 3 | include ../include/make.inc 4 | 5 | .PHONY: binaries 6 | 7 | build: binaries 8 | 9 | rebuild: binaries 10 | 11 | binaries: setup/lib/setproctitle-install.tar.gz 12 | 13 | setup/lib/setproctitle-install.tar.gz: 14 | ./setup/create-binaries.sh 15 | 16 | clean: 17 | rm -rf ./setup/lib 18 | rm -rf `find . -name '*~'` 19 | -------------------------------------------------------------------------------- /nginx-django/Makefile: -------------------------------------------------------------------------------- 1 | BASENAME = nginx-django 2 | 3 | include ../include/make.inc 4 | 5 | .PHONY: binaries 6 | 7 | build: binaries 8 | 9 | rebuild: binaries 10 | 11 | binaries: setup/lib/uwsgi-install.tar.gz 12 | 13 | setup/lib/uwsgi-install.tar.gz: 14 | ./setup/create-binaries.sh 15 | 16 | clean: 17 | rm -rf ./setup/lib 18 | rm -rf `find . -name '*~' -o -name '__pycache__'` 19 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/README.txt: -------------------------------------------------------------------------------- 1 | All icons are taken from Font Awesome (http://fontawesome.io/) project. 2 | The Font Awesome font is licensed under the SIL OFL 1.1: 3 | - http://scripts.sil.org/OFL 4 | 5 | SVG icons source: https://github.com/encharm/Font-Awesome-SVG-PNG 6 | Font-Awesome-SVG-PNG is licensed under the MIT license (see file license 7 | in current folder). 8 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/icon-addlink.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/tooltag-add.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /include/general.elt: -------------------------------------------------------------------------------- 1 | *EOLS LF 2 | @5 3 | 4 | # General tests which all chaperone builds should pass 5 | 6 | ; Basic install test 7 | >chaperone --version 8 | env | sort 12 | >APPS_DIR=/apps 13 | >VAR_DIR=/apps/var 14 | >USER=runapps 15 | 16 | ; Check to be sure chaperone is running as PID 1 17 | >ps ax 18 | < +1 .+:00 \[chaperone\] /bin/bash 19 | -------------------------------------------------------------------------------- /centosbase/Dockerfile.tpl: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | #MAINTAINER Gary Wisniewski 3 | 4 | ADD setup/ /setup-baseimage/ 5 | RUN /setup-baseimage/install.sh 6 | 7 | # Environment Variables 8 | 9 | # _CHAP_OPTIONS - Used instead entrypoint args so that any default can be overridden by CMD 10 | ENV _CHAP_OPTIONS="--config apps/chaperone.d --default-home / --user runapps" 11 | 12 | ENTRYPOINT ["/usr/bin/chaperone"] 13 | -------------------------------------------------------------------------------- /alpinebase/Dockerfile.tpl: -------------------------------------------------------------------------------- 1 | FROM alpine:3.2 2 | #MAINTAINER Gary Wisniewski 3 | 4 | ADD setup/ /setup-baseimage/ 5 | RUN /setup-baseimage/install.sh 6 | 7 | # Environment Variables 8 | 9 | # _CHAP_OPTIONS - Used instead entrypoint args so that any default can be overridden by CMD 10 | ENV _CHAP_OPTIONS="--config apps/chaperone.d --default-home / --user runapps" 11 | 12 | ENTRYPOINT ["/usr/local/bin/chaperone"] 13 | -------------------------------------------------------------------------------- /baseimage/Dockerfile.tpl: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | #MAINTAINER Gary Wisniewski 3 | 4 | ADD setup/ /setup-baseimage/ 5 | RUN /setup-baseimage/install.sh 6 | 7 | # Environment Variables 8 | 9 | # _CHAP_OPTIONS - Used instead entrypoint args so that any default can be overridden by CMD 10 | ENV _CHAP_OPTIONS="--config apps/chaperone.d --default-home / --user runapps" 11 | 12 | ENTRYPOINT ["/usr/local/bin/chaperone"] 13 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/js/prepopulate.min.js: -------------------------------------------------------------------------------- 1 | (function(c){c.fn.prepopulate=function(e,f,g){return this.each(function(){var a=c(this),b=function(){if(!a.data("_changed")){var b=[];c.each(e,function(a,d){d=c(d);0 2 | 3 | 4 | 15 | 16 | Container Processes 17 | 18 |
19 | 
22 | 
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/templates/chapinfo/process_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | Container Processes 17 | 18 |
19 | {{ procoutput }}
20 | 
21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /apache/setup/apps/www/default/process_list.shtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | Container Processes 17 | 18 |
19 | 
20 | 
21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/icon-changelink.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/js/jquery.init.js: -------------------------------------------------------------------------------- 1 | /*global django:true, jQuery:false*/ 2 | /* Puts the included jQuery into our own namespace using noConflict and passing 3 | * it 'true'. This ensures that the included jQuery doesn't pollute the global 4 | * namespace (i.e. this preserves pre-existing values for both window.$ and 5 | * window.jQuery). 6 | */ 7 | var django = django || {}; 8 | django.jQuery = jQuery.noConflict(true); 9 | -------------------------------------------------------------------------------- /lamp/setup/apps/www/default/process_list.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | Container Processes 17 | 18 |
19 | 
22 | 
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/icon-deletelink.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url 2 | 3 | from . import views 4 | 5 | app_name = 'polls' 6 | urlpatterns = [ 7 | url(r'^$', views.IndexView.as_view(), name='index'), 8 | url(r'^(?P[0-9]+)/$', views.DetailView.as_view(), name='detail'), 9 | url(r'^(?P[0-9]+)/results/$', views.ResultsView.as_view(), name='results'), 10 | url(r'^(?P[0-9]+)/vote/$', views.vote, name='vote'), 11 | ] 12 | 13 | -------------------------------------------------------------------------------- /baseimage/setup/apps/etc/skel/clone/bash.bashrc.tpl: -------------------------------------------------------------------------------- 1 | # Bash start-up file, created by chaplocal 2 | 3 | export PROMPT_DIRTRIM=2 4 | cd $APPS_DIR 5 | 6 | echo "" 7 | echo "Now running inside container. Directory is: $APPS_DIR" 8 | echo "" 9 | 10 | port=${CONFIG_EXT_HTTP_PORT:-${CONFIG_EXT_PORT:-}} 11 | if [ "$port" != "" -a "$HTTPD_SERVER_NAME" != "" ]; then 12 | echo "The default '$HTTPD_SERVER_NAME' site is running at http://$CONFIG_EXT_HOSTNAME:$port/" 13 | echo "" 14 | fi 15 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/icon-yes.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/mysite/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for mysite project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /lamp/setup/apps/etc/mysql/start_mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # For a general query log, include the following: 4 | # --general-log-file=$VAR_DIR/log/mysqld-query.log 5 | # --general-log=1 6 | 7 | exec /usr/sbin/mysqld \ 8 | --defaults-file=$APPS_DIR/etc/mysql/my.cnf \ 9 | --user ${USER:-mysql} \ 10 | --datadir=$VAR_DIR/mysql \ 11 | --socket=/tmp/mysqld.sock \ 12 | --pid-file=/tmp/mysqld.pid \ 13 | --log-error=$VAR_DIR/log/mysqld-error.log \ 14 | --plugin-dir=/usr/lib/var/mysql/plugin 15 | -------------------------------------------------------------------------------- /lemp/setup/apps/etc/mysql/start_mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # For a general query log, include the following: 4 | # --general-log-file=$VAR_DIR/log/mysqld-query.log 5 | # --general-log=1 6 | 7 | exec /usr/sbin/mysqld \ 8 | --defaults-file=$APPS_DIR/etc/mysql/my.cnf \ 9 | --user ${USER:-mysql} \ 10 | --datadir=$VAR_DIR/mysql \ 11 | --socket=/tmp/mysqld.sock \ 12 | --pid-file=/tmp/mysqld.pid \ 13 | --log-error=$VAR_DIR/log/mysqld-error.log \ 14 | --plugin-dir=/usr/lib/var/mysql/plugin 15 | -------------------------------------------------------------------------------- /lemp/setup/apps/etc/start_nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Startup nginx 3 | # 4 | # Note that all of the .tpl files are copied to locations in ${VAR_DIR} 5 | # since nginx does not consistently support environment variables within configs. 6 | 7 | mkdir -p $VAR_DIR/etc $VAR_DIR/sites.d $VAR_DIR/log/nginx 8 | 9 | tpl_envcp --overwrite --strip .tpl $APPS_DIR/etc/*.tpl $VAR_DIR/etc 10 | tpl_envcp --overwrite --strip .tpl $APPS_DIR/www/sites.d/*.tpl $VAR_DIR/sites.d 11 | 12 | /usr/sbin/nginx -c $VAR_DIR/etc/nginx.conf 13 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/etc/start_nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Startup nginx 3 | # 4 | # Note that all of the .tpl files are copied to locations in ${VAR_DIR} 5 | # since nginx does not consistently support environment variables within configs. 6 | 7 | mkdir -p $VAR_DIR/etc $VAR_DIR/sites.d $VAR_DIR/log/nginx 8 | 9 | tpl_envcp --overwrite --strip .tpl $APPS_DIR/etc/*.tpl $VAR_DIR/etc 10 | tpl_envcp --overwrite --strip .tpl $APPS_DIR/www/sites.d/*.tpl $VAR_DIR/sites.d 11 | 12 | /usr/sbin/nginx -c $VAR_DIR/etc/nginx.conf 13 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /apache/setup/apps/etc/skel/help/LAUNCHER.tpl: -------------------------------------------------------------------------------- 1 | 2 | The %(DEFAULT_LAUNCHER) script is a quick-start for launching 3 | the %(PARENT_IMAGE) image. 4 | 5 | When you launch the container, there will be a default sample site 6 | visible at http://%(CONFIG_EXT_HOSTNAME)%(CONFIG_EXT_HTTP_PORT:|80||:%(CONFIG_EXT_HTTP_PORT))/ 7 | 8 | To get this message again: 9 | docker run -i --rm %(PARENT_IMAGE) --task get-help LAUNCHER 10 | 11 | Or, for geeneral help on the image itself: 12 | docker run -i --rm %(PARENT_IMAGE) --task get-help 13 | -------------------------------------------------------------------------------- /lamp/setup/apps/etc/skel/help/LAUNCHER.tpl: -------------------------------------------------------------------------------- 1 | 2 | The %(DEFAULT_LAUNCHER) script is a quick-start for launching 3 | the %(PARENT_IMAGE) image. 4 | 5 | When you launch the container, there will be a default sample site 6 | visible at http://%(CONFIG_EXT_HOSTNAME)%(CONFIG_EXT_HTTP_PORT:|80||:%(CONFIG_EXT_HTTP_PORT))/ 7 | 8 | To get this message again: 9 | docker run -i --rm %(PARENT_IMAGE) --task get-help LAUNCHER 10 | 11 | Or, for geeneral help on the image itself: 12 | docker run -i --rm %(PARENT_IMAGE) --task get-help 13 | -------------------------------------------------------------------------------- /lemp/setup/apps/etc/skel/help/LAUNCHER.tpl: -------------------------------------------------------------------------------- 1 | 2 | The %(DEFAULT_LAUNCHER) script is a quick-start for launching 3 | the %(PARENT_IMAGE) image. 4 | 5 | When you launch the container, there will be a default sample site 6 | visible at http://%(CONFIG_EXT_HOSTNAME)%(CONFIG_EXT_HTTP_PORT:|80||:%(CONFIG_EXT_HTTP_PORT))/ 7 | 8 | To get this message again: 9 | docker run -i --rm %(PARENT_IMAGE) --task get-help LAUNCHER 10 | 11 | Or, for geeneral help on the image itself: 12 | docker run -i --rm %(PARENT_IMAGE) --task get-help 13 | -------------------------------------------------------------------------------- /alpine-nginx-php/tests/main-np.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-image 2 | 3 | ~$EL_include_dir/general.elt 4 | 5 | @5 6 | >fgrep startup.sh /apps/var/log/syslog.log 7 | ps axw 12 | <\[chaperone\] 13 | wget -O - http://localhost:8080 | fgrep ls-high 18 | < etc 19 | < startup.d 20 | < var 21 | < www 22 | -------------------------------------------------------------------------------- /apache/tests/main-apache.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-image 2 | 3 | ~$EL_include_dir/general.elt 4 | 5 | @5 6 | >fgrep startup.sh /apps/var/log/syslog.log 7 | ps axw 12 | <\[chaperone\] 13 | curl http://localhost:8080 | fgrep ls-high 18 | < etc 19 | < startup.d 20 | < var 21 | < www 22 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/etc/skel/help/LAUNCHER.tpl: -------------------------------------------------------------------------------- 1 | 2 | The %(DEFAULT_LAUNCHER) script is a quick-start for launching 3 | the %(PARENT_IMAGE) image. 4 | 5 | When you launch the container, there will be a default sample site 6 | visible at http://%(CONFIG_EXT_HOSTNAME)%(CONFIG_EXT_HTTP_PORT:|80||:%(CONFIG_EXT_HTTP_PORT))/ 7 | 8 | To get this message again: 9 | docker run -i --rm %(PARENT_IMAGE) --task get-help LAUNCHER 10 | 11 | Or, for geeneral help on the image itself: 12 | docker run -i --rm %(PARENT_IMAGE) --task get-help 13 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/etc/skel/help/LAUNCHER.tpl: -------------------------------------------------------------------------------- 1 | 2 | The %(DEFAULT_LAUNCHER) script is a quick-start for launching 3 | the %(PARENT_IMAGE) image. 4 | 5 | When you launch the container, there will be a default Django sample site 6 | visible at http://%(CONFIG_EXT_HOSTNAME)%(CONFIG_EXT_HTTP_PORT:|80||:%(CONFIG_EXT_HTTP_PORT))/ 7 | 8 | To get this message again: 9 | docker run -i --rm %(PARENT_IMAGE) --task get-help LAUNCHER 10 | 11 | Or, for geeneral help on the image itself: 12 | docker run -i --rm %(PARENT_IMAGE) --task get-help 13 | -------------------------------------------------------------------------------- /include/buildenv.inc: -------------------------------------------------------------------------------- 1 | # Build environment variables, linked from each setup directory. 2 | 3 | BUILD_CHAPERONE_INSTALL="pip3 install chaperone" 4 | 5 | # Use to build images with a custom version of Chaperone, usually for pre-release testing purposes. This loads 6 | # chaperone from a webserver running in another container, usually the chaperone/sandbox/distserv server, but 7 | # can access the source distribution from anywhere. 8 | #BUILD_CHAPERONE_INSTALL="pip3 install http://`ip route | awk '/default via/{print $3}'`:9980/dist/chaperone-0.3.4.tar.gz" 9 | -------------------------------------------------------------------------------- /apache/setup/apps/etc/ssleay.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # SSLeay example configuration file. 3 | # 4 | 5 | RANDFILE = /dev/urandom 6 | 7 | [ req ] 8 | default_bits = 2048 9 | default_keyfile = privkey.pem 10 | distinguished_name = req_distinguished_name 11 | prompt = no 12 | policy = policy_anything 13 | req_extensions = v3_req 14 | x509_extensions = v3_req 15 | 16 | [ req_distinguished_name ] 17 | commonName = @HostName@ 18 | 19 | [ v3_req ] 20 | basicConstraints = CA:FALSE 21 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/startup.d/210-django-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ $VAR_INIT != 1 ] && exit 4 | 5 | # Only do the following if the VAR directory is being set up 6 | 7 | cd $APPS_DIR/www/django_sample 8 | ./manage.py migrate 9 | 10 | # Create superuser with username=admin and password=ChangeMe 11 | ./manage.py createsuperuser --username=admin --email=admin@example.com --noinput 12 | ./manage.py shell < 2 | 3 | 4 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/css/fonts.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Roboto'; 3 | src: url('../fonts/Roboto-Bold-webfont.woff'); 4 | font-weight: 700; 5 | font-style: normal; 6 | } 7 | 8 | @font-face { 9 | font-family: 'Roboto'; 10 | src: url('../fonts/Roboto-Regular-webfont.woff'); 11 | font-weight: 400; 12 | font-style: normal; 13 | } 14 | 15 | @font-face { 16 | font-family: 'Roboto'; 17 | src: url('../fonts/Roboto-Light-webfont.woff'); 18 | font-weight: 300; 19 | font-style: normal; 20 | } 21 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | class Question(models.Model): 5 | question_text = models.CharField(max_length=200) 6 | pub_date = models.DateTimeField('date published') 7 | 8 | def __str__(self): 9 | return self.question_text 10 | 11 | class Choice(models.Model): 12 | question = models.ForeignKey(Question, on_delete=models.CASCADE) 13 | choice_text = models.CharField(max_length=200) 14 | votes = models.IntegerField(default=0) 15 | 16 | def __str__(self): 17 | return self.choice_text 18 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/templates/polls/detail.html: -------------------------------------------------------------------------------- 1 |

{{ question.question_text }}

2 | 3 | {% if error_message %}

{{ error_message }}

{% endif %} 4 | 5 |
6 | {% csrf_token %} 7 | {% for choice in question.choice_set.all %} 8 | 9 |
10 | {% endfor %} 11 | 12 |
13 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/icon-no.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/inline-delete.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Gary J. Wisniewski 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /nginx-django/tests/main-np.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-image 2 | 3 | ~$EL_include_dir/general.elt 4 | 5 | @5 6 | >fgrep startup.sh /apps/var/log/syslog.log 7 | ps axw 12 | <\[chaperone\] 13 | curl -sL http://localhost:8080 | fgrep ls-high 18 | < etc 19 | < startup.d 20 | < var 21 | < www 22 | >curl -sL http://localhost:8080/sample.html | fgrep drwxr-xr-x 23 | < django_sample 24 | < sites.d 25 | < uwsgi.d 26 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* DASHBOARD */ 2 | 3 | .dashboard .module table th { 4 | width: 100%; 5 | } 6 | 7 | .dashboard .module table td { 8 | white-space: nowrap; 9 | } 10 | 11 | .dashboard .module table td a { 12 | display: block; 13 | padding-right: .6em; 14 | } 15 | 16 | /* RECENT ACTIONS MODULE */ 17 | 18 | .module ul.actionlist { 19 | margin-left: 0; 20 | } 21 | 22 | ul.actionlist li { 23 | list-style-type: none; 24 | } 25 | 26 | ul.actionlist li { 27 | overflow: hidden; 28 | text-overflow: ellipsis; 29 | -o-text-overflow: ellipsis; 30 | } 31 | -------------------------------------------------------------------------------- /alpine-nginx-django/tests/main-np.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-image 2 | 3 | ~$EL_include_dir/general.elt 4 | 5 | @5 6 | >fgrep startup.sh /apps/var/log/syslog.log 7 | ps axw 12 | <\[chaperone\] 13 | wget -O - http://localhost:8080 | fgrep ls-high 18 | < etc 19 | < startup.d 20 | < var 21 | < www 22 | >wget -O - http://localhost:8080/sample.html | fgrep drwxr-xr-x 23 | < django_sample 24 | < sites.d 25 | < uwsgi.d 26 | -------------------------------------------------------------------------------- /lemp/setup/apps/startup.d/nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # System-prep tasks for nginx 3 | 4 | puser=${USER:-www-data} 5 | needs_perm="/var/log/nginx $VAR_DIR/etc $VAR_DIR/sites.d" 6 | 7 | function dolog() { logger -t nginx.sh -p info $*; } 8 | 9 | if [ $CONTAINER_INIT == 1 ]; then 10 | dolog setting nginx user permissions for "$puser" 11 | # Ngnix simply refuses to start unless it can write to /var/log/nginx. Nobody seems to complain, 12 | # but i think this is because people don't try running nginx in userspace very often. 13 | sudo bash -c "mv /var/log/nginx /var/log/nginx-dist; mkdir -p $needs_perm; chown -R $puser: $needs_perm; chmod 777 /var/log/nginx" 14 | fi 15 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Preamble derived from the prepare.sh script from https://github.com/phusion/baseimage-docker. 4 | # Thank you, phusion, for all the lessons learned. 5 | 6 | apk add --update nginx php-fpm php-cli php-sqlite3 openssl 7 | 8 | # Copy new apps files into /apps 9 | cp -av /setup-np/apps/* /apps 10 | mv /setup-np/this_version.inc /apps/etc/version.inc 11 | chown -R runapps: /apps 12 | 13 | # Remove sample application from chaperone.d 14 | rm /apps/chaperone.d/200-userapp.conf 15 | rm /apps/bin/sample_app 16 | 17 | # Do other cleanups 18 | rm -r /setup-np 19 | rm -rf /tmp/* /var/tmp/* /var/cache/apk/* 20 | rm -f `find /apps -name '*~'` 21 | echo done. 22 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/js/collapse.min.js: -------------------------------------------------------------------------------- 1 | (function(a){a(document).ready(function(){a("fieldset.collapse").each(function(b,c){0===a(c).find("div.errors").length&&a(c).addClass("collapsed").find("h2").first().append(' ('+gettext("Show")+")")});a("fieldset.collapse a.collapse-toggle").click(function(b){a(this).closest("fieldset").hasClass("collapsed")?a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]):a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", 2 | [a(this).attr("id")]);return!1})})})(django.jQuery); 3 | -------------------------------------------------------------------------------- /baseimage/setup/apps/chaperone.d/300-logrotate.conf: -------------------------------------------------------------------------------- 1 | # 300-logrotate.conf 2 | # 3 | # This is disabled by default. 4 | # 5 | # However, you can enable this to run logrotation daily, and customize $(APPS_DIR)/etc/logrotate.conf 6 | # to indicate which logs should be rotated. 7 | 8 | logrotate.service: { 9 | enabled: false, 10 | type: cron, 11 | interval: "25 6 * * *", # uses standard crontab format. 12 | command: "/usr/sbin/logrotate -s $(VAR_DIR)/run/logrotate.status $(APPS_DIR)/etc/logrotate.conf", 13 | optional: true, # don't worry if logrotate isn't even installed 14 | directory: "$(VAR_DIR)/log", 15 | ignore_failures: true, # problems are best just investigated rather than causing problems 16 | } 17 | -------------------------------------------------------------------------------- /lamp/tests/tasks-lamp.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-command 2 | 3 | >TASK get-help 4 | TASK get-launcher | sh 7 | ./run-lamp.sh 10 | netstat -na 12 | exit 16 | >sed -e 's/PORT=8080/PORT=7777/' -i run-lamp.sh 17 | >EXT_SSL_HOSTNAME=testhost.example.com ./run-lamp.sh 18 | >fgrep 'new private key' $VAR_DIR/log/syslog.log 19 | exit 21 | >./run-lamp.sh --task get-help 22 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/icon-unknown.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /apache/tests/tasks-apache.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-command 2 | 3 | >TASK get-help 4 | TASK get-launcher | sh 7 | ./run-apache.sh 10 | netstat -na 12 | exit 16 | >sed -e 's/PORT=8080/PORT=7777/' -i run-apache.sh 17 | >EXT_SSL_HOSTNAME=testhost.example.com ./run-apache.sh 18 | >fgrep 'new private key' $VAR_DIR/log/syslog.log 19 | exit 21 | >./run-apache.sh --task get-help 22 | TASK get-help 4 | TASK get-launcher | sh 7 | ./run-lemp.sh 10 | netstat -na 12 | exit 16 | >sed -e 's/PORT=8080/PORT=7777/' -i run-lemp.sh 17 | >EXT_SSL_HOSTNAME=testhost.example.com ./run-lemp.sh 18 | >fgrep 'new private key' $VAR_DIR/log/syslog.log 19 | netstat -na 21 | <0.0:8443 22 | >exit 23 | >./run-lemp.sh --task get-help 24 | &/dev/null 11 | fi 12 | 13 | if [ $VAR_INIT == 1 ]; then 14 | if [ ! -d $vardbdir ]; then 15 | dolog "copying distribution $distdir to $vardbdir" 16 | sudo bash -c "cp -a $distdir-dist $vardbdir; chown -R ${USER:-mysql} $vardbdir" 17 | else 18 | dolong "existing $vardbdir found when initializing $VAR_DIR for the first time, not changed." 19 | fi 20 | fi 21 | -------------------------------------------------------------------------------- /lemp/setup/apps/startup.d/mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | distdir=/var/lib/mysql 4 | vardbdir=$VAR_DIR/mysql 5 | 6 | function dolog() { logger -t mysql.sh -p info $*; } 7 | 8 | if [ $CONTAINER_INIT == 1 ]; then 9 | dolog "hiding distribution mysql files in /etc so no clients see them" 10 | sudo bash -c "cd /etc; mv my.cnf my.cnf-dist; mv mysql mysql-dist; mv $distdir $distdir-dist" >&/dev/null 11 | fi 12 | 13 | if [ $VAR_INIT == 1 ]; then 14 | if [ ! -d $vardbdir ]; then 15 | dolog "copying distribution $distdir to $vardbdir" 16 | sudo bash -c "cp -a $distdir-dist $vardbdir; chown -R ${USER:-mysql} $vardbdir" 17 | else 18 | dolong "existing $vardbdir found when initializing $VAR_DIR for the first time, not changed." 19 | fi 20 | fi 21 | -------------------------------------------------------------------------------- /nginx-django/tests/tasks-np.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-command 2 | 3 | >TASK get-help 4 | TASK get-launcher | sh 7 | ./run-nginx-django.sh 10 | netstat -na 12 | exit 16 | >sed -e 's/PORT=8080/PORT=7777/' -i run-nginx-django.sh 17 | >EXT_SSL_HOSTNAME=testhost.example.com ./run-nginx-django.sh 18 | >fgrep 'new private key' $VAR_DIR/log/syslog.log 19 | exit 21 | >./run-nginx-django.sh --task get-help 22 | ps ax 7 | <00 \[chaperone\] /bin/bash 8 | <00 /bin/bash 9 | <00 ps ax 10 | 11 | ; Ask telchap if things are sane 12 | >telchap status 13 | < CONSOLE .+ running 14 | < logrotate\.service +false +disabled 15 | < sample\.service +true +started 16 | < startup\.service +true +started 17 | 18 | ; Try stopping the sample service 19 | >telchap reset sample 20 | telchap start sample 24 | telchap stop CONSOLE 29 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /alpine-nginx-php/tests/tasks-np.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-command 2 | 3 | >TASK get-help 4 | TASK get-launcher | sh 7 | ./run-alpine-nginx-php.sh 10 | netstat -na 12 | exit 16 | >sed -e 's/PORT=8080/PORT=7777/' -i run-alpine-nginx-php.sh 17 | >EXT_SSL_HOSTNAME=testhost.example.com ./run-alpine-nginx-php.sh 18 | >fgrep 'new private key' $VAR_DIR/log/syslog.log 19 | exit 21 | >./run-alpine-nginx-php.sh --task get-help 22 | TASK get-help 4 | TASK get-launcher | sh 7 | ./run-alpine-nginx-django.sh 10 | netstat -na 12 | exit 16 | >sed -e 's/PORT=8080/PORT=7777/' -i run-alpine-nginx-django.sh 17 | >EXT_SSL_HOSTNAME=testhost.example.com ./run-alpine-nginx-django.sh 18 | >fgrep 'new private key' $VAR_DIR/log/syslog.log 19 | exit 21 | >./run-alpine-nginx-django.sh --task get-help 22 | /dev/null # inhibits carriage return if -t was specified 5 | fi 6 | 7 | if [ "$CHAP_TASK_MODE" != "1" ]; then 8 | echo "get-chaplocal' should only be run in chaperone --task mode from the docker host" 9 | exit 1 10 | fi 11 | 12 | helpfile=HELP 13 | 14 | if [ "$1" != "" -a "$1" != "/bin/bash" ]; then 15 | helpfile="$1" 16 | fi 17 | 18 | function expand_template() { tpl_envcp - <$1; } 19 | skel=$APPS_DIR/etc/skel 20 | 21 | if [ ! -f "$skel/help/$helpfile.tpl" ]; then 22 | cat <fgrep startup.sh /apps/var/log/syslog.log 6 | ps axw 11 | <\[chaperone\] 12 | curl http://localhost:8080 | fgrep ls-high 18 | < etc 19 | < startup.d 20 | < var 21 | < www 22 | 23 | # Check mysql var setup 24 | 25 | >ls -l /apps/var/mysql 26 | < ibdata1 27 | < ib_logfile0 28 | < phpmyadmin 29 | 30 | # And phpmyadmin 31 | 32 | >curl http://localhost:8080/phpmyadmin/ | fgrep password 33 | /etc/apt/apt.conf.d/01proxy 17 | echo Note: Found apt-get proxy on $defhost:3142 18 | else 19 | rm -f /etc/apt/apt.conf.d/01proxy 20 | echo Note: Did not find apt-get proxy on $defhost:3142 21 | fi 22 | -------------------------------------------------------------------------------- /nginx-django/setup/apt_setproxy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # If our host has an apt proxy container running at 3142, then use it for apt 3 | # This is a nice way to optimize builds. Just 4 | # docker run sameersbn/apt-cacher-ng -p 3142:3142 and then your installs can use 5 | # the proxy to speed things up. 6 | 7 | defhost=`ip route | awk '/default/ { print $3; }'` 8 | 9 | if [ "$1" == "off" -o ! -x /bin/nc ]; then 10 | rm -f /etc/apt/apt.conf.d/01proxy 11 | echo Note: apt-get proxy not in use 12 | exit 13 | fi 14 | 15 | if nc -z $defhost 3142; then 16 | echo "Acquire::http { Proxy \"http://$defhost:3142\"; };" >/etc/apt/apt.conf.d/01proxy 17 | echo Note: Found apt-get proxy on $defhost:3142 18 | else 19 | rm -f /etc/apt/apt.conf.d/01proxy 20 | echo Note: Did not find apt-get proxy on $defhost:3142 21 | fi 22 | -------------------------------------------------------------------------------- /alpinebase/setup/apps/etc/README: -------------------------------------------------------------------------------- 1 | This is a "mini etc" directory which, as much as possible, is where all normal application and service configuration 2 | files are stored. For example, in the chaperone-lamp configuration, all MySQL and Apache configurations are stored 3 | here, but may make reference to other files on the system (such as modules and plugins). However, the normal 4 | startup files in /etc/apache2 and /etc/mysql are not used, as they expect a normal fully-booted system. 5 | 6 | System start-up is controlled by the startup.sh script, which reads additional startup files from ../startup.d. 7 | 8 | This is not built into chaperone, but rather is a custom configuration defined within chaperone.d. If you want, 9 | you can completely change the way things work and invent new startup schemes. But, this is a good place to start. 10 | -------------------------------------------------------------------------------- /baseimage/setup/apps/chaperone.d/005-config.conf: -------------------------------------------------------------------------------- 1 | # 005-config.conf 2 | # 3 | # Put container configuration variables here. This should strictly be for configuration 4 | # variables that are passed into the container. 100% of container configuraiton should 5 | # be possible by setting these variables here or on the 'docker run' command line. 6 | 7 | settings: { 8 | env_set: { 9 | 10 | # This is the hostname of the host machine. Generally, this is only needed 11 | # by certain applications (such as those supporting SSL certiifcates, but is common 12 | # enough to include as a standard option. 13 | 14 | CONFIG_EXT_HOSTNAME: "$(CONFIG_EXT_HOSTNAME:-localhost)", 15 | 16 | # Create additional configuration variables here. Start them with "CONFIG_" 17 | # so they can be easily identified... 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /baseimage/setup/apps/etc/README: -------------------------------------------------------------------------------- 1 | This is a "mini etc" directory which, as much as possible, is where all normal application and service configuration 2 | files are stored. For example, in the chaperone-lamp configuration, all MySQL and Apache configurations are stored 3 | here, but may make reference to other files on the system (such as modules and plugins). However, the normal 4 | startup files in /etc/apache2 and /etc/mysql are not used, as they expect a normal fully-booted system. 5 | 6 | System start-up is controlled by the startup.sh script, which reads additional startup files from ../startup.d. 7 | 8 | This is not built into chaperone, but rather is a custom configuration defined within chaperone.d. If you want, 9 | you can completely change the way things work and invent new startup schemes. But, this is a good place to start. 10 | -------------------------------------------------------------------------------- /baseimage/tests/main-baseimage.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-image 2 | 3 | ~$EL_include_dir/general.elt 4 | 5 | ; Check to be sure all processes are running 6 | >ps ax 7 | <00 \[chaperone\] /bin/bash 8 | <00 /bin/bash 9 | <00 ps ax 10 | 11 | ; Allow environment to settle so process notifications complete 12 | >sleep 1 13 | ; Ask telchap if things are sane 14 | >telchap status 15 | < CONSOLE .+ running 16 | < logrotate\.service +false +disabled 17 | < sample\.service +true +started 18 | < startup\.service +true +started 19 | 20 | ; Try stopping the sample service 21 | >telchap reset sample 22 | telchap start sample 26 | telchap stop CONSOLE 31 | ps ax 7 | <00 \[chaperone\] /bin/bash 8 | <00 /bin/bash 9 | <00 ps ax 10 | 11 | ; Allow environment to settle so process notifications complete 12 | >sleep 1 13 | ; Ask telchap if things are sane 14 | >telchap status 15 | < CONSOLE .+ running 16 | < logrotate\.service +false +disabled 17 | < sample\.service +true +started 18 | < startup\.service +true +started 19 | 20 | ; Try stopping the sample service 21 | >telchap reset sample 22 | telchap start sample 26 | telchap stop CONSOLE 31 | fgrep startup.sh /apps/var/log/syslog.log 6 | ps axw 12 | <\[chaperone\] 13 | curl http://localhost:8080 | fgrep ls-high 21 | < chaperone.d 22 | < etc 23 | < startup.d 24 | < var 25 | < www 26 | 27 | # Check mysql var setup 28 | 29 | >ls -l /apps/var/mysql 30 | < ibdata1 31 | < ib_logfile0 32 | < phpmyadmin 33 | 34 | # And phpmyadmin 35 | 36 | >curl http://localhost:8080/phpmyadmin/ | fgrep password 37 | echo $JAVA_HOME 7 | java -version 9 | ps ax 14 | <00 \[chaperone\] /bin/bash 15 | <00 /bin/bash 16 | <00 ps ax 17 | 18 | ; Ask telchap if things are sane 19 | >telchap status 20 | < CONSOLE .+ running 21 | < logrotate\.service +false +disabled 22 | < sample\.service +true +started 23 | < startup\.service +true +started 24 | 25 | ; Try stopping the sample service 26 | >telchap reset sample 27 | telchap start sample 31 | telchap stop CONSOLE 36 | TASK get-help 8 | TASK get-launcher | sh 14 | ./run-baseimage.sh 16 | exit 19 | 20 | # Now use get-chaplocal to set up a dev environment and see if it's 21 | # running properly. 22 | 23 | >TASK get-chaplocal | sh 24 | ./chaplocal cltest 27 | ls -l 33 | exit 36 | -------------------------------------------------------------------------------- /centosbase/tests/tasks-centosbase.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-command 2 | 3 | @5 4 | 5 | # Test get-help command 6 | 7 | >TASK get-help 8 | TASK get-launcher | sh 14 | ./run-centosbase.sh 16 | exit 19 | 20 | # Now use get-chaplocal to set up a dev environment and see if it's 21 | # running properly. 22 | 23 | >TASK get-chaplocal | sh 24 | ./chaplocal cltest 27 | ls -l 33 | exit 36 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/views.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | from django.shortcuts import get_object_or_404, render 4 | 5 | container_name = os.environ['CONTAINER_NAME'] + " Container" 6 | 7 | LS_CMD = """cd $APPS_DIR; ls -l | sed -r 's/^.*(etc|var|chaperone.d|startup.d|var|www|build.sh)$/\\0<\/span>/'""" 8 | 9 | def generic(request, pagename): 10 | context = { 11 | 'container': container_name, 12 | 'env': os.environ, 13 | 'development_mode': os.environ['APPS_DIR'] != '/apps', 14 | } 15 | if pagename == "process_list.html": 16 | context['procoutput'] = subprocess.check_output("ps", shell=True) 17 | elif pagename == "index.html": 18 | context['ls_output'] = subprocess.check_output(LS_CMD, shell=True) 19 | elif pagename == "sample.html": 20 | context['ls_output'] = subprocess.check_output("cd $APPS_DIR/www; ls -l", shell=True) 21 | 22 | return render(request, 'chapinfo/' + pagename, context) 23 | -------------------------------------------------------------------------------- /alpinebase/tests/tasks-alpinebase.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-command 2 | 3 | @5 4 | 5 | # Test get-help command 6 | 7 | >TASK get-help 8 | TASK get-launcher | sh 14 | ./run-alpinebase.sh 16 | exit 19 | >rm run-alpinebase.sh 20 | 21 | # Now use get-chaplocal to set up a dev environment and see if it's 22 | # running properly. 23 | 24 | >TASK get-chaplocal | sh 25 | ./chaplocal cltest 28 | ls -l 34 | exit 37 | -------------------------------------------------------------------------------- /alpinejava/tests/tasks-alpinejava.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-command 2 | 3 | @5 4 | 5 | # Test get-help command 6 | 7 | >TASK get-help 8 | TASK get-launcher | sh 14 | ./run-alpinejava.sh 16 | exit 19 | >rm run-alpinejava.sh 20 | 21 | # Now use get-chaplocal to set up a dev environment and see if it's 22 | # running properly. 23 | 24 | >TASK get-chaplocal | sh 25 | ./chaplocal cltest 28 | ls -l 34 | exit 37 | -------------------------------------------------------------------------------- /baseimage/setup/dot.bashrc: -------------------------------------------------------------------------------- 1 | # ~/.bashrc: executed by bash(1) for non-login shells. 2 | # This is a simpler, stripped-down version for containers 3 | 4 | # If not running interactively, don't do anything 5 | [ -z "$PS1" ] && return 6 | 7 | # don't put duplicate lines in the history. See bash(1) for more options 8 | # ... or force ignoredups and ignorespace 9 | HISTCONTROL=ignoredups:ignorespace 10 | 11 | # append to the history file, don't overwrite it 12 | shopt -s histappend 13 | 14 | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) 15 | HISTSIZE=1000 16 | HISTFILESIZE=2000 17 | 18 | # make less more friendly for non-text input files, see lesspipe(1) 19 | [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" 20 | 21 | case "$TERM" in 22 | xterm*|rxvt*) 23 | PS1="\[\u@\h: \w\a\]$PS1" 24 | ;; 25 | *) 26 | ;; 27 | esac 28 | 29 | # some more ls aliases 30 | alias ll='ls -alF' 31 | alias la='ls -A' 32 | alias l='ls -CF' 33 | 34 | # Alias definitions. 35 | if [ -f ~/.bash_aliases ]; then 36 | . ~/.bash_aliases 37 | fi 38 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/mysite/urls.py: -------------------------------------------------------------------------------- 1 | """mysite URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/1.9/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Add an import: from blog import urls as blog_urls 14 | 2. Import the include() function: from django.conf.urls import url, include 15 | 3. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) 16 | """ 17 | from django.conf.urls import url, include 18 | from django.contrib import admin 19 | 20 | urlpatterns = [ 21 | url(r'^polls/', include('polls.urls')), 22 | url(r'^admin/', admin.site.urls), 23 | url(r'^', include('chapinfo.urls')), 24 | ] 25 | -------------------------------------------------------------------------------- /alpinebase/setup/dot.bashrc: -------------------------------------------------------------------------------- 1 | # ~/.bashrc: executed by bash(1) for non-login shells. 2 | # This is a simpler, stripped-down version for containers 3 | 4 | # If not running interactively, don't do anything 5 | [ -z "$PS1" ] && return 6 | 7 | # don't put duplicate lines in the history. See bash(1) for more options 8 | # ... or force ignoredups and ignorespace 9 | HISTCONTROL=ignoredups:ignorespace 10 | 11 | # append to the history file, don't overwrite it 12 | shopt -s histappend 13 | 14 | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) 15 | HISTSIZE=1000 16 | HISTFILESIZE=2000 17 | 18 | # make less more friendly for non-text input files, see lesspipe(1) 19 | [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" 20 | 21 | case "$TERM" in 22 | xterm*|rxvt*) 23 | PS1="\[\u@\h: \w\a\]$PS1" 24 | ;; 25 | *) 26 | ;; 27 | esac 28 | 29 | # some more ls aliases 30 | alias ll='ls -alF' 31 | alias la='ls -A' 32 | alias l='ls -CF' 33 | 34 | # Alias definitions. 35 | if [ -f ~/.bash_aliases ]; then 36 | . ~/.bash_aliases 37 | fi 38 | -------------------------------------------------------------------------------- /baseimage/setup/apps/README: -------------------------------------------------------------------------------- 1 | This is a self-contained system directory managed by Chaperone. 2 | 3 | Everything is here: configuration, log files, user data. 4 | 5 | You can: 6 | 7 | - Put this directory on a shared volume so you can do development (chaplocal does 8 | this for you if you want). 9 | - Copy it back to /apps to create production instances. 10 | 11 | The idea is to isolate all system configuration in a "mini-environment" here in 12 | the apps directory rather than trying to cajole the many installed services in 13 | the container to operate differently than they may be originally configured 14 | by the distro. 15 | 16 | So, for example, you'll find all your logs here in ./var/log. The logging 17 | strategy is up to you, but initially syslog and chaperone errors will be sent to 18 | stdout, while other types of informational messages get stored in log files. 19 | See 010-start.conf for the logging configuration. 20 | 21 | All of this can be changed, and this environment is not dictated by chaperone. 22 | It's just a starting point defined by chaperone-baseimage and chaperone-lamp 23 | to get things started. 24 | -------------------------------------------------------------------------------- /lamp/setup/apps/chaperone.d/105-mysqld.conf: -------------------------------------------------------------------------------- 1 | # 105-mysql.conf 2 | # 3 | # Start up the mysql server using the start_mysql.sh script. Since this startup file comes after the initial 4 | # 010-start.conf, these settings will be added to the mix. Note that specifying the MySQL port works 5 | # in most cases, but not all. You'll see this in the apache2.conf configuration where PHP 6 | # has to be told separately about the new socket. 7 | # 8 | # Starting MySQL this way has the advantage that the entire system, including MySQL, can run as the 9 | # start-up user (the one specified with --user or --create on the chaperone command line). 10 | 11 | settings: { 12 | env_set: { 13 | 'MYSQL_HOME': '$(APPS_DIR)/etc/mysql', 14 | 'MYSQL_UNIX_PORT': '/tmp/mysqld.sock', 15 | }, 16 | } 17 | 18 | # mysql is defined as a simple service type (the default). Chaperone will therefore montior the daemon, 19 | # restarting it if need be. 20 | 21 | mysql.service: { 22 | type: simple, 23 | command: "$(APPS_DIR)/etc/mysql/start_mysql.sh", 24 | pidfile: "/tmp/mysqld.pid", 25 | restart: true, 26 | enabled: true, 27 | service_groups: database, 28 | } 29 | -------------------------------------------------------------------------------- /baseimage/setup/apps/etc/skel/shell_vars.inc: -------------------------------------------------------------------------------- 1 | # Variables commonly defined in get-* tasks, so that they can be 2 | # available in templates. See bin/get-help and bin/get-launcher. 3 | 4 | source $APPS_DIR/etc/version.inc 5 | export IMAGE_VERSION IMAGE_ARCH IMAGE_NAMESPACE 6 | export PARENT_IMAGE=$IMAGE_NAME 7 | 8 | # The image name, without the prefix. 9 | if [[ "$PARENT_IMAGE" == $IMAGE_NAMESPACE/* ]]; then 10 | # Standard namespace naming. Remove namespace/chaperone- or just namespace/ 11 | IMAGE_BASENAME=${PARENT_IMAGE/*$IMAGE_NAMESPACE\/chaperone-/} 12 | export IMAGE_BASENAME=${IMAGE_BASENAME/*$IMAGE_NAMESPACE\//} 13 | else 14 | export IMAGE_BASENAME=${PARENT_IMAGE#*/} # others just strip off username 15 | fi 16 | 17 | # The name of the default launcher (this is what run-IMAGE.sh.tpl gets delivered as) 18 | export DEFAULT_LAUNCHER=run-$IMAGE_BASENAME.sh 19 | 20 | # Used by get-launcher turn .tpl pathnames into the basename delivered. 21 | 22 | function transform_filename() { 23 | base=$(basename $1) 24 | [ "$base" == "run-IMAGE.sh.tpl" ] && echo $DEFAULT_LAUNCHER && return 25 | echo "${base%.tpl}" 26 | } 27 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/gis/move_vertex_off.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/gis/move_vertex_on.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/icon-calendar.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /lemp/setup/apps/www/sites.d/php-fast.inc.tpl: -------------------------------------------------------------------------------- 1 | location ~ \.php$ { 2 | fastcgi_param QUERY_STRING $query_string; 3 | fastcgi_param REQUEST_METHOD $request_method; 4 | fastcgi_param CONTENT_TYPE $content_type; 5 | fastcgi_param CONTENT_LENGTH $content_length; 6 | 7 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 8 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 9 | fastcgi_param REQUEST_URI $request_uri; 10 | fastcgi_param DOCUMENT_URI $document_uri; 11 | fastcgi_param DOCUMENT_ROOT $document_root; 12 | fastcgi_param SERVER_PROTOCOL $server_protocol; 13 | 14 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 15 | fastcgi_param SERVER_SOFTWARE nginx; 16 | 17 | fastcgi_param REMOTE_ADDR $remote_addr; 18 | fastcgi_param REMOTE_PORT $remote_port; 19 | fastcgi_param SERVER_ADDR $server_addr; 20 | fastcgi_param SERVER_PORT $server_port; 21 | fastcgi_param SERVER_NAME $server_name; 22 | 23 | fastcgi_pass unix:%(PHPFFM_SOCKET); 24 | } 25 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/calendar-icons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Code Charm Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/www/sites.d/php-fast.inc.tpl: -------------------------------------------------------------------------------- 1 | location ~ \.php$ { 2 | fastcgi_param QUERY_STRING $query_string; 3 | fastcgi_param REQUEST_METHOD $request_method; 4 | fastcgi_param CONTENT_TYPE $content_type; 5 | fastcgi_param CONTENT_LENGTH $content_length; 6 | 7 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 8 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 9 | fastcgi_param REQUEST_URI $request_uri; 10 | fastcgi_param DOCUMENT_URI $document_uri; 11 | fastcgi_param DOCUMENT_ROOT $document_root; 12 | fastcgi_param SERVER_PROTOCOL $server_protocol; 13 | 14 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 15 | fastcgi_param SERVER_SOFTWARE nginx; 16 | 17 | fastcgi_param REMOTE_ADDR $remote_addr; 18 | fastcgi_param REMOTE_PORT $remote_port; 19 | fastcgi_param SERVER_ADDR $server_addr; 20 | fastcgi_param SERVER_PORT $server_port; 21 | fastcgi_param SERVER_NAME $server_name; 22 | 23 | fastcgi_pass unix:%(PHPFFM_SOCKET); 24 | } 25 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/img/sorting-icons.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /apache/setup/apps/etc/skel/help/HELP.tpl: -------------------------------------------------------------------------------- 1 | Help for Image: %(PARENT_IMAGE) Version %(IMAGE_VERSION) 2 | Chaperone: %(`chaperone --version | awk '/This is/{print $5}'`) 3 | Linux: %(`cat /etc/issue | head -1 | sed -e 's/Welcome to //' -e 's/ \\.*$//'`) 4 | 5 | This image contains a minimally-configured Apache server as a starting 6 | point. 7 | 8 | When you launch the container, there will be a default sample site 9 | visible at http://%(CONFIG_EXT_HOSTNAME)%(CONFIG_EXT_HTTP_PORT:|80||:%(CONFIG_EXT_HTTP_PORT))/ 10 | (Assuming you haven't changed the default port.) 11 | 12 | If you are a developer, the best way to learn about this image is to create a 13 | local development directory. You can do this automatically using the 14 | 'chaplocal' command, which will guide you to the next step: 15 | 16 | $ docker run -i --rm %(PARENT_IMAGE) --task get-chaplocal | sh 17 | 18 | You can extract also ready-made startup scripts for this image by running 19 | the following command: 20 | 21 | $ docker run -i --rm %(PARENT_IMAGE) --task get-launcher | sh 22 | 23 | Startup scripts have the option of working with attached storage. 24 | Each script is self-documenting and has configuration variables 25 | at the beginning of the script itself. 26 | -------------------------------------------------------------------------------- /nginx-django/setup/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Preamble derived from the prepare.sh script from https://github.com/phusion/baseimage-docker. 4 | # Thank you, phusion, for all the lessons learned. 5 | 6 | /setup-np/apt_setproxy on 7 | 8 | add-apt-repository ppa:nginx/stable 9 | 10 | apt-get update 11 | apt-get install -y nginx openssl libpython3.4 12 | pip3 install django 13 | 14 | # Copy new apps files into /apps 15 | cp -a /setup-np/apps/* /apps 16 | 17 | # Install prebuilt binaries 18 | (cd /; tar xzf /setup-np/lib/uwsgi-install.tar.gz) 19 | 20 | # Remove any stray files, then compile all python files so there are .pyc equivalents 21 | rm -rf `find /apps -name '*~' -o -name '__pycache__'` 22 | python3 -m compileall -f -q /apps/www 23 | 24 | mv /setup-np/this_version.inc /apps/etc/version.inc 25 | chown -R runapps: /apps 26 | 27 | # Remove sample application from chaperone.d 28 | rm /apps/chaperone.d/200-userapp.conf 29 | rm /apps/bin/sample_app 30 | 31 | # Clean up apt 32 | apt-get clean 33 | /setup-np/apt_setproxy off 34 | rm -rf /var/lib/apt/lists/* 35 | rm -f /etc/dpkg/dpkg.cfg.d/02apt-speedup 36 | 37 | # Do other cleanups 38 | rm -r /setup-np 39 | rm -rf /tmp/* /var/tmp/* /var/cache/apk/* 40 | rm -f `find /apps -name '*~'` 41 | echo done. 42 | -------------------------------------------------------------------------------- /apache/setup/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Preamble derived from the prepare.sh script from https://github.com/phusion/baseimage-docker. 4 | # Thank you, phusion, for all the lessons learned. 5 | 6 | MYSQL_ROOT_PW='ChangeMe' 7 | 8 | export DEBIAN_FRONTEND=noninteractive 9 | 10 | function do_apt_install() { 11 | apt-get install -y --no-install-recommends $* 12 | } 13 | 14 | # Use a proxy if we have one set up 15 | /setup-apache/apt_setproxy on 16 | 17 | # update indices 18 | apt-get update 19 | 20 | # Copy new apps files into /apps 21 | cp -av /setup-apache/apps/* /apps 22 | mv /setup-apache/this_version.inc /apps/etc/version.inc 23 | chown -R runapps: /apps 24 | 25 | # Remove sample application and irrelevant templates 26 | rm /apps/chaperone.d/200-userapp.conf 27 | rm /apps/bin/sample_app 28 | 29 | # Normal install steps 30 | do_apt_install apache2 apache2-utils 31 | a2enmod include cgi # these are needed by the sample site (SSI, wow, blast from the past!) 32 | 33 | # Clean up apt 34 | apt-get clean 35 | /setup-apache/apt_setproxy off 36 | rm -rf /var/lib/apt/lists/* 37 | rm -f /etc/dpkg/dpkg.cfg.d/02apt-speedup 38 | 39 | # Do other cleanups 40 | rm -r /setup-apache 41 | rm -rf /tmp/* /var/tmp/* 42 | rm -f `find /apps -name '*~'` 43 | echo done. 44 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/js/vendor/xregexp/LICENSE-XREGEXP.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2007-2012 Steven Levithan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/etc/skel/help/HELP.tpl: -------------------------------------------------------------------------------- 1 | Help for Image: %(PARENT_IMAGE) Version %(IMAGE_VERSION) 2 | Chaperone: %(`chaperone --version | awk '/This is/{print $5}'`) 3 | Linux: %(`cat /etc/issue | head -1 | sed -e 's/Welcome to //' -e 's/ \\.*$//'`) 4 | 5 | This image contains an Alpine Linux Nginx/PHP server stack as a starting 6 | point for application development. 7 | 8 | When you launch the container, there will be a default sample site 9 | visible at http://%(CONFIG_EXT_HOSTNAME)%(CONFIG_EXT_HTTP_PORT:|80||:%(CONFIG_EXT_HTTP_PORT))/ 10 | (Assuming you haven't changed the default port.) 11 | 12 | If you are a developer, the best way to learn about this image is to create a 13 | local development directory. You can do this automatically using the 14 | 'chaplocal' command, which will guide you to the next step: 15 | 16 | $ docker run -i --rm %(PARENT_IMAGE) --task get-chaplocal | sh 17 | 18 | You can extract also ready-made startup scripts for this image by running 19 | the following command: 20 | 21 | $ docker run -i --rm %(PARENT_IMAGE) --task get-launcher | sh 22 | 23 | Startup scripts have the option of working with attached storage. 24 | Each script is self-documenting and has configuration variables 25 | at the beginning of the script itself. 26 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/js/collapse.js: -------------------------------------------------------------------------------- 1 | /*global gettext*/ 2 | (function($) { 3 | 'use strict'; 4 | $(document).ready(function() { 5 | // Add anchor tag for Show/Hide link 6 | $("fieldset.collapse").each(function(i, elem) { 7 | // Don't hide if fields in this fieldset have errors 8 | if ($(elem).find("div.errors").length === 0) { 9 | $(elem).addClass("collapsed").find("h2").first().append(' (' + gettext("Show") + 11 | ')'); 12 | } 13 | }); 14 | // Add toggle to anchor tag 15 | $("fieldset.collapse a.collapse-toggle").click(function(ev) { 16 | if ($(this).closest("fieldset").hasClass("collapsed")) { 17 | // Show 18 | $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]); 19 | } else { 20 | // Hide 21 | $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]); 22 | } 23 | return false; 24 | }); 25 | }); 26 | })(django.jQuery); 27 | -------------------------------------------------------------------------------- /lamp/setup/apps/etc/skel/help/HELP.tpl: -------------------------------------------------------------------------------- 1 | Help for Image: %(PARENT_IMAGE) Version %(IMAGE_VERSION) 2 | Chaperone: %(`chaperone --version | awk '/This is/{print $5}'`) 3 | Linux: %(`cat /etc/issue | head -1 | sed -e 's/Welcome to //' -e 's/ \\.*$//'`) 4 | 5 | This image contains an Apache/MySQL/PHP server stack as a starting 6 | point for application development. The 'phpmyadmin' package is also 7 | pre-configured to provide easy MySQL configuration and set-up. 8 | 9 | When you launch the container, there will be a default sample site 10 | visible at http://%(CONFIG_EXT_HOSTNAME)%(CONFIG_EXT_HTTP_PORT:|80||:%(CONFIG_EXT_HTTP_PORT))/ 11 | (Assuming you haven't changed the default port.) 12 | 13 | If you are a developer, the best way to learn about this image is to create a 14 | local development directory. You can do this automatically using the 15 | 'chaplocal' command, which will guide you to the next step: 16 | 17 | $ docker run -i --rm %(PARENT_IMAGE) --task get-chaplocal | sh 18 | 19 | You can extract also ready-made startup scripts for this image by running 20 | the following command: 21 | 22 | $ docker run -i --rm %(PARENT_IMAGE) --task get-launcher | sh 23 | 24 | Startup scripts have the option of working with attached storage. 25 | Each script is self-documenting and has configuration variables 26 | at the beginning of the script itself. 27 | -------------------------------------------------------------------------------- /lemp/setup/apps/etc/skel/help/HELP.tpl: -------------------------------------------------------------------------------- 1 | Help for Image: %(PARENT_IMAGE) Version %(IMAGE_VERSION) 2 | Chaperone: %(`chaperone --version | awk '/This is/{print $5}'`) 3 | Linux: %(`cat /etc/issue | head -1 | sed -e 's/Welcome to //' -e 's/ \\.*$//'`) 4 | 5 | This image contains an Nginx/MySQL/PHP server stack as a starting 6 | point for application development. The 'phpmyadmin' package is also 7 | pre-configured to provide easy MySQL configuration and set-up. 8 | 9 | When you launch the container, there will be a default sample site 10 | visible at http://%(CONFIG_EXT_HOSTNAME)%(CONFIG_EXT_HTTP_PORT:|80||:%(CONFIG_EXT_HTTP_PORT))/ 11 | (Assuming you haven't changed the default port.) 12 | 13 | If you are a developer, the best way to learn about this image is to create a 14 | local development directory. You can do this automatically using the 15 | 'chaplocal' command, which will guide you to the next step: 16 | 17 | $ docker run -i --rm %(PARENT_IMAGE) --task get-chaplocal | sh 18 | 19 | You can extract also ready-made startup scripts for this image by running 20 | the following command: 21 | 22 | $ docker run -i --rm %(PARENT_IMAGE) --task get-launcher | sh 23 | 24 | Startup scripts have the option of working with attached storage. 25 | Each script is self-documenting and has configuration variables 26 | at the beginning of the script itself. 27 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/etc/skel/help/HELP.tpl: -------------------------------------------------------------------------------- 1 | Help for Image: %(PARENT_IMAGE) Version %(IMAGE_VERSION) 2 | Django: %(`django-admin --version`) 3 | UWSGI: %(`uwsgi --version`) 4 | Chaperone: %(`chaperone --version | awk '/This is/{print $5}'`) 5 | Linux: %(`cat /etc/issue | head -1 | sed -e 's/Welcome to //' -e 's/ \\.*$//'`) 6 | 7 | This image contains an Nginx/uwsgi/Django server stack as a starting 8 | point for application development. 9 | 10 | When you launch the container, there will be a default sample Django site 11 | visible at http://%(CONFIG_EXT_HOSTNAME)%(CONFIG_EXT_HTTP_PORT:|80||:%(CONFIG_EXT_HTTP_PORT))/ 12 | (Assuming you haven't changed the default port.) 13 | 14 | If you are a developer, the best way to learn about this image is to create a 15 | local development directory. You can do this automatically using the 16 | 'chaplocal' command, which will guide you to the next step: 17 | 18 | $ docker run -i --rm %(PARENT_IMAGE) --task get-chaplocal | sh 19 | 20 | You can extract also ready-made startup scripts for this image by running 21 | the following command: 22 | 23 | $ docker run -i --rm %(PARENT_IMAGE) --task get-launcher | sh 24 | 25 | Startup scripts have the option of working with attached storage. 26 | Each script is self-documenting and has configuration variables 27 | at the beginning of the script itself. 28 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/etc/skel/clone/build/install.sh.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /setup 4 | 5 | # remove existing chaperone.d and startup.d from /apps so none linger 6 | rm -rf /apps; mkdir /apps 7 | 8 | # copy everything from setup to the root /apps except Dockerfile rebuild materials 9 | echo copying application files to /apps ... 10 | tar cf - --exclude ./build --exclude ./build.sh --exclude ./run.sh . | (cd /apps; tar xf -) 11 | 12 | # Update the version information, if a replacement exists 13 | [ -f /setup/build/new_version.inc ] && mv /setup/build/new_version.inc /apps/etc/version.inc 14 | 15 | # PHP EXTENSIONS! 16 | # 17 | # Add any php extensions your application needs. Alpine Linux is VERY granular and 18 | # does not contain the large number of extensions you'd expect in a Ubuntu/Debian/CentOS 19 | # install. You can find the package names here... 20 | # https://pkgs.alpinelinux.org/packages?name=php-%25&repo=all&arch=x86_64&maintainer=all 21 | 22 | ## Uncomment and customize... 23 | # apk --update add \ 24 | # php-json \ 25 | # php-ctype \ 26 | # php-gd \ 27 | # php-curl \ 28 | # php-openssl \ 29 | # php-zip 30 | 31 | # Add additional setup commands for your production image here, if any. 32 | # ... 33 | 34 | # Clean up and assure permissions are correct 35 | 36 | rm -rf /setup 37 | chown -R runapps: /apps # for full-container execution 38 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/etc/skel/clone/build/install.sh.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /setup 4 | 5 | # remove existing chaperone.d and startup.d from /apps so none linger 6 | rm -rf /apps; mkdir /apps 7 | 8 | # copy everything from setup to the root /apps except Dockerfile rebuild materials 9 | echo copying application files to /apps ... 10 | tar cf - --exclude ./build --exclude ./build.sh --exclude ./run.sh . | (cd /apps; tar xf -) 11 | 12 | # Update the version information, if a replacement exists 13 | [ -f /setup/build/new_version.inc ] && mv /setup/build/new_version.inc /apps/etc/version.inc 14 | 15 | # Django Extensions 16 | # 17 | # This build uses Python3, so you'll need to install any Django extensions from PyPi using 18 | # the pip3 command. You may also need to add additional Alpine linux packages, listed here: 19 | # https://pkgs.alpinelinux.org/packages?name=php-%25&repo=all&arch=x86_64&maintainer=all 20 | 21 | ## Uncomment and customize... 22 | # pip3 install django-registration ... 23 | # ... 24 | # Plus any OS dependencies... 25 | # apk --update add xxx (for Alpine) 26 | # yum install xxx (for Centos) 27 | # apt-get install xxx (for Ubuntu) 28 | 29 | # Add additional setup commands for your production image here, if any. 30 | # ... 31 | 32 | # Clean up and assure permissions are correct 33 | 34 | rm -rf /setup 35 | chown -R runapps: /apps # for full-container execution 36 | -------------------------------------------------------------------------------- /baseimage/setup/apps/bin/clone-apps: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Used to clone the /apps hierarchy into a new develoment directory using 3 | # clone skeletons. 4 | 5 | DESTPATH="$1" 6 | UIDGID="$2" 7 | SKEL="$APPS_DIR/etc/skel" 8 | CLONESKEL="$SKEL/clone" 9 | 10 | if [ "$CHAP_TASK_MODE" != "1" ]; then 11 | echo "'clone-apps' should only be run in chaperone --task mode from the docker host" 12 | exit 1 13 | fi 14 | 15 | if [ "$DESTPATH" == "" -o "$UIDGID" == "" ]; then 16 | echo 'Usage: clone-apps :' 17 | exit 18 | fi 19 | 20 | if [ "${DESTPATH#/}" == "${DESTPATH}" ]; then 21 | echo "Error: must be an absolute path, $DESTPATH" 22 | exit 1 23 | fi 24 | 25 | if [ -e "$DESTPATH" ]; then 26 | if [ "$(ls $DESTPATH)" != "" ]; then 27 | echo "Error: already exists and is not empty, $DESTPATH" 28 | exit 1 29 | fi 30 | fi 31 | 32 | # Clone the actual directory 33 | (cd $APPS_DIR; tar cf - --exclude ./var .) | (mkdir -p $DESTPATH; cd $DESTPATH; tar xf -) 34 | 35 | cd $CLONESKEL 36 | skelfiles=`find . -name '*.tpl'` 37 | cd $DESTPATH 38 | 39 | source $SKEL/shell_vars.inc 40 | 41 | for tpl in $skelfiles; do 42 | tpl=${tpl#./} 43 | tdir=$(dirname $tpl) 44 | if [ "$tdir" != "." ]; then 45 | mkdir -p $tdir 46 | fi 47 | if [ ! -f "${tpl%.tpl}" ]; then 48 | tpl_envcp -a $CLONESKEL/$tpl ${tpl%.tpl} 49 | fi 50 | done 51 | 52 | chown -R $UIDGID $DESTPATH 53 | -------------------------------------------------------------------------------- /baseimage/setup/apps/etc/skel/launcher/run-IMAGE.sh.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Extracted from %(PARENT_IMAGE) on %(`date`) 3 | 4 | # Run as interactive: ./%(DEFAULT_LAUNCHER) [options] 5 | # or daemon: ./%(DEFAULT_LAUNCHER) -d [options] 6 | 7 | IMAGE="%(PARENT_IMAGE)" 8 | INTERACTIVE_SHELL="/bin/bash" 9 | 10 | # Uncomment to include port settings 11 | #PORTOPT="-p x:y" 12 | 13 | EXT_HOSTNAME=%(CONFIG_EXT_HOSTNAME:-localhost) 14 | 15 | # If this directory exists and is writable, then it will be used 16 | # as attached storage 17 | STORAGE_LOCATION="$PWD/%(IMAGE_BASENAME)-storage" 18 | STORAGE_USER="$USER" 19 | 20 | # The rest should be OK... 21 | 22 | if [ "$1" == '-d' ]; then 23 | shift 24 | docker_opt="-d $PORTOPT" 25 | INTERACTIVE_SHELL="" 26 | else 27 | docker_opt="-t -i -e TERM=$TERM --rm=true $PORTOPT" 28 | fi 29 | 30 | 31 | if [ "$STORAGE_LOCATION" != "" -a -d "$STORAGE_LOCATION" -a -w "$STORAGE_LOCATION" ]; then 32 | SELINUX_FLAG=$(sestatus 2>/dev/null | fgrep -q enabled && echo :z) 33 | docker_opt="$docker_opt -v $STORAGE_LOCATION:/apps/var$SELINUX_FLAG" 34 | chap_opt="--create $STORAGE_USER:/apps/var" 35 | echo Using attached storage at $STORAGE_LOCATION 36 | fi 37 | 38 | # Determine if we need to use 'sudo' 39 | DOCKER_CMD=$(docker version >/dev/null 2>&1 && echo docker || echo 'sudo docker') 40 | 41 | $DOCKER_CMD run $docker_opt $IMAGE $chap_opt $* $INTERACTIVE_SHELL 42 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9 on 2015-12-30 22:31 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | initial = True 12 | 13 | dependencies = [ 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Choice', 19 | fields=[ 20 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('choice_text', models.CharField(max_length=200)), 22 | ('votes', models.IntegerField(default=0)), 23 | ], 24 | ), 25 | migrations.CreateModel( 26 | name='Question', 27 | fields=[ 28 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 29 | ('question_text', models.CharField(max_length=200)), 30 | ('pub_date', models.DateTimeField(verbose_name='date published')), 31 | ], 32 | ), 33 | migrations.AddField( 34 | model_name='choice', 35 | name='question', 36 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.Question'), 37 | ), 38 | ] 39 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/js/vendor/jquery/LICENSE-JQUERY.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | ==== 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining 10 | a copy of this software and associated documentation files (the 11 | "Software"), to deal in the Software without restriction, including 12 | without limitation the rights to use, copy, modify, merge, publish, 13 | distribute, sublicense, and/or sell copies of the Software, and to 14 | permit persons to whom the Software is furnished to do so, subject to 15 | the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be 18 | included in all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | -------------------------------------------------------------------------------- /alpinejava/setup/apps/etc/skel/help/HELP.tpl: -------------------------------------------------------------------------------- 1 | Help for Image: %(PARENT_IMAGE) Version %(IMAGE_VERSION) 2 | Chaperone: %(`chaperone --version | awk '/This is/{print $5}'`) 3 | Oracle Java: %(`java -version 2>&1 | sed -n -e 's|.*"\(.*\)"|\1|p'`) 4 | Linux: %(`cat /etc/issue | head -1 | sed -e 's/Welcome to //' -e 's/ \\.*$//'`) 5 | 6 | This is a Chaperone image based upon Alpine Linux which has the Oracle 7 | Java JDK and JRE installed. It is a starting point for Java-based 8 | applications. 9 | 10 | This image won't do much by itself, but a good way to see how it is 11 | built is to try: 12 | 13 | $ docker run -i -t --rm %(PARENT_IMAGE) /bin/bash 14 | 15 | The above will start the container and put you in a 'bash' shell so you 16 | can look around. 17 | 18 | The entire "world" of the application will be located in the /apps 19 | 20 | Take a look at the configuration files in /apps/chaperone.d to see how 21 | the system is configured for startup. There is also a sample application 22 | (just a simple Java app) with a sample start-up config '200-userapp.conf'. 23 | 24 | You can extract ready-made startup scripts for this image by running 25 | the following command: 26 | 27 | $ docker run -i --rm %(PARENT_IMAGE) --task get-launcher | sh 28 | 29 | If you are a developer and want to create your own local development 30 | directory with this image as the infrastructure provider, use: 31 | 32 | $ docker run -i --rm %(PARENT_IMAGE) --task get-chaplocal | sh 33 | -------------------------------------------------------------------------------- /baseimage/setup/apps/etc/skel/help/HELP.tpl: -------------------------------------------------------------------------------- 1 | Help for Image: %(PARENT_IMAGE) Version %(IMAGE_VERSION) 2 | Chaperone: %(`chaperone --version | awk '/This is/{print $5}'`) 3 | Linux: %(`( cat /etc/system-release 2>/dev/null || cat /etc/issue ) | head -1 | sed -e 's/Welcome to //' -e 's/ \\.*$//'`) 4 | 5 | This is a minimal Chaperone image to use as a starting-point 6 | for creating Docker containers. It contains basic configuration templates, 7 | as well as a sane method of starting scripts and related services. 8 | 9 | This image won't do much by itself, but a good way to see how it is 10 | built is to try: 11 | 12 | $ docker run -i -t --rm %(PARENT_IMAGE) /bin/bash 13 | 14 | The above will start the container and put you in a 'bash' shell so you 15 | can look around. 16 | 17 | The entire "world" of the application will be located in the /apps 18 | 19 | Take a look at the configuration files in /apps/chaperone.d to see how 20 | the system is configured for startup. There is also a sample application 21 | (just a simple shell script) with a sample start-up script '200-userapp.conf'. 22 | 23 | You can extract ready-made startup scripts for this image by running 24 | the following command: 25 | 26 | $ docker run -i --rm %(PARENT_IMAGE) --task get-launcher | sh 27 | 28 | If you are a developer and want to create your own local development 29 | directory with this image as the infrastructure provider, use: 30 | 31 | $ docker run -i --rm %(PARENT_IMAGE) --task get-chaplocal | sh 32 | -------------------------------------------------------------------------------- /apache/setup/apps/startup.d/150-ssl-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Takes care of setting up SSL by generating a snakeoil key (self-signed) whenever 4 | # CONFIG_EXT_SSL_HOSTNAME is defined. You'll need to reconfigure your webserver with 5 | # actual keys if you want to serve https properly. 6 | 7 | certpem=$VAR_DIR/certs/ssl-cert-snakeoil.pem 8 | certkey=$VAR_DIR/certs/ssl-cert-snakeoil.key 9 | 10 | # Only if we have CONFIG_EXT_SSL_HOSTNAME... 11 | 12 | if [ "$CONFIG_EXT_SSL_HOSTNAME" != "" ]; then 13 | # Generate testing certs if they aren't here. 14 | if [ ! -f $certpem ]; then 15 | template="$APPS_DIR/etc/ssleay.cnf" 16 | 17 | # # should be a less common char 18 | # problem is that openssl virtually accepts everything and we need to 19 | # sacrifice one char. 20 | 21 | TMPFILE="$(mktemp)" || exit 1 22 | 23 | sed -e s#@HostName@#"$CONFIG_EXT_SSL_HOSTNAME"# $template > $TMPFILE 24 | 25 | # create the certificate. 26 | 27 | mkdir -p $VAR_DIR/certs 28 | 29 | openssl req -config $TMPFILE -new -x509 -days 3650 -nodes -out $certpem -keyout $certkey 30 | 31 | chmod 644 $certpem 32 | chmod 640 $certkey 33 | 34 | rm -rf $TMPFILE 35 | fi 36 | 37 | # Enable apache SSL... 38 | # If this FAILS it is probably because (a) SECURE_ROOT was set to true and 39 | # (b) the SSL hostname was added after the apps directory was already initailized. 40 | if [ "$HTTPD_SERVER_NAME" == 'apache' -a "$CONFIG_EXT_SSL_HOSTNAME" != "" ]; then 41 | sudo a2enmod ssl 42 | fi 43 | 44 | fi 45 | -------------------------------------------------------------------------------- /baseimage/setup/apps/etc/skel/clone/build/README.tpl: -------------------------------------------------------------------------------- 1 | This directory contains a template for creating derivative images 2 | based upon '%(PARENT_IMAGE)'. 3 | 4 | Note that these build materials will NOT become a part of the newly created image. 5 | Instead, new build materials will be created if somebody wants to use 'chaplocal' 6 | to continue development. 7 | 8 | To make a complete, ready-to-go image, you should do the following: 9 | 10 | 1. Customize Dockerfile in the application root directory (our parent) 11 | 12 | 2. Customize install.sh by adding any additional build commands. 13 | 14 | 3. If you want to cater to developers who want to use this image, then 15 | modify the skeleton files in ../etc/skel as described below. 16 | 17 | 4. Usually, you can just create a new .git project at in the same 18 | directory where your build.sh is located. 19 | 20 | Modifying the Skelenton Files 21 | 22 | The ../etc/skel directory contains skeleton template files which are used: 23 | * To output container-specific help using "--task get-help" 24 | * To create container-specific launchers using "--task get-launcher" 25 | * To create new development directories using 'chaplocal'. 26 | 27 | At a minimum, you should modify: ../etc/skel/help and ../etc/skel/launcher 28 | to reflect the needs of your container. 29 | 30 | If you want to improve the experience for developers using your image, then 31 | also modify the templates in ../etc/clone. 'chaplocal' uses these files when 32 | it clones a new 'apps' directory for a developer. 33 | -------------------------------------------------------------------------------- /lamp/setup/apps/chaperone.d/005-config.conf: -------------------------------------------------------------------------------- 1 | # 005-config.conf 2 | # 3 | # Put container configuration variables here. This should strictly be for configuration 4 | # variables that are passed into the container. 100% of container configuraiton should 5 | # be possible by setting these variables here or on the 'docker run' command line. 6 | 7 | settings: { 8 | 9 | env_set: { 10 | 11 | # This is the hostname of the host machine. Generally, this is only needed 12 | # by certain applications (such as those supporting SSL certiifcates, but is common 13 | # enough to include as a standard option. 14 | 15 | CONFIG_EXT_HOSTNAME: "$(CONFIG_EXT_HOSTNAME:-localhost)", 16 | 17 | # HTTP ports of exported ports. These are good policy to define in your "docker run" 18 | # command so that internal applications know what ports the public interfaces are 19 | # visible on. Sometimes this is necessary, such as when appliations push their 20 | # endpoints via API's or when webservers do redirects. The default launchers 21 | # for Chaperone containers handle this for you automatically. 22 | 23 | CONFIG_EXT_HTTP_PORT: "$(CONFIG_EXT_HTTP_PORT:-8080)", 24 | CONFIG_EXT_HTTPS_PORT: "$(CONFIG_EXT_HTTPS_PORT:-8443)", 25 | 26 | # Configure this to enable SSL and generate snakeoil keys for the given domain 27 | CONFIG_EXT_SSL_HOSTNAME: "$(CONFIG_EXT_SSL_HOSTNAME:-)", 28 | 29 | # Create additional configuration variables here. Start them with "CONFIG_" 30 | # so they can be easily identified... 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /lemp/setup/apps/chaperone.d/005-config.conf: -------------------------------------------------------------------------------- 1 | # 005-config.conf 2 | # 3 | # Put container configuration variables here. This should strictly be for configuration 4 | # variables that are passed into the container. 100% of container configuraiton should 5 | # be possible by setting these variables here or on the 'docker run' command line. 6 | 7 | settings: { 8 | 9 | env_set: { 10 | 11 | # This is the hostname of the host machine. Generally, this is only needed 12 | # by certain applications (such as those supporting SSL certiifcates, but is common 13 | # enough to include as a standard option. 14 | 15 | CONFIG_EXT_HOSTNAME: "$(CONFIG_EXT_HOSTNAME:-localhost)", 16 | 17 | # HTTP ports of exported ports. These are good policy to define in your "docker run" 18 | # command so that internal applications know what ports the public interfaces are 19 | # visible on. Sometimes this is necessary, such as when appliations push their 20 | # endpoints via API's or when webservers do redirects. The default launchers 21 | # for Chaperone containers handle this for you automatically. 22 | 23 | CONFIG_EXT_HTTP_PORT: "$(CONFIG_EXT_HTTP_PORT:-8080)", 24 | CONFIG_EXT_HTTPS_PORT: "$(CONFIG_EXT_HTTPS_PORT:-8443)", 25 | 26 | # Configure this to enable SSL and generate snakeoil keys for the given domain 27 | CONFIG_EXT_SSL_HOSTNAME: "$(CONFIG_EXT_SSL_HOSTNAME:-)", 28 | 29 | # Create additional configuration variables here. Start them with "CONFIG_" 30 | # so they can be easily identified... 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /apache/setup/apps/chaperone.d/005-config.conf: -------------------------------------------------------------------------------- 1 | # 005-config.conf 2 | # 3 | # Put container configuration variables here. This should strictly be for configuration 4 | # variables that are passed into the container. 100% of container configuraiton should 5 | # be possible by setting these variables here or on the 'docker run' command line. 6 | 7 | settings: { 8 | 9 | env_set: { 10 | 11 | # This is the hostname of the host machine. Generally, this is only needed 12 | # by certain applications (such as those supporting SSL certiifcates, but is common 13 | # enough to include as a standard option. 14 | 15 | CONFIG_EXT_HOSTNAME: "$(CONFIG_EXT_HOSTNAME:-localhost)", 16 | 17 | # HTTP ports of exported ports. These are good policy to define in your "docker run" 18 | # command so that internal applications know what ports the public interfaces are 19 | # visible on. Sometimes this is necessary, such as when appliations push their 20 | # endpoints via API's or when webservers do redirects. The default launchers 21 | # for Chaperone containers handle this for you automatically. 22 | 23 | CONFIG_EXT_HTTP_PORT: "$(CONFIG_EXT_HTTP_PORT:-8080)", 24 | CONFIG_EXT_HTTPS_PORT: "$(CONFIG_EXT_HTTPS_PORT:-8443)", 25 | 26 | # Configure this to enable SSL and generate snakeoil keys for the given domain 27 | CONFIG_EXT_SSL_HOSTNAME: "$(CONFIG_EXT_SSL_HOSTNAME:-)", 28 | 29 | # Create additional configuration variables here. Start them with "CONFIG_" 30 | # so they can be easily identified... 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/chaperone.d/005-config.conf: -------------------------------------------------------------------------------- 1 | # 005-config.conf 2 | # 3 | # Put container configuration variables here. This should strictly be for configuration 4 | # variables that are passed into the container. 100% of container configuraiton should 5 | # be possible by setting these variables here or on the 'docker run' command line. 6 | 7 | settings: { 8 | 9 | env_set: { 10 | 11 | # This is the hostname of the host machine. Generally, this is only needed 12 | # by certain applications (such as those supporting SSL certiifcates, but is common 13 | # enough to include as a standard option. 14 | 15 | CONFIG_EXT_HOSTNAME: "$(CONFIG_EXT_HOSTNAME:-localhost)", 16 | 17 | # HTTP ports of exported ports. These are good policy to define in your "docker run" 18 | # command so that internal applications know what ports the public interfaces are 19 | # visible on. Sometimes this is necessary, such as when appliations push their 20 | # endpoints via API's or when webservers do redirects. The default launchers 21 | # for Chaperone containers handle this for you automatically. 22 | 23 | CONFIG_EXT_HTTP_PORT: "$(CONFIG_EXT_HTTP_PORT:-8080)", 24 | CONFIG_EXT_HTTPS_PORT: "$(CONFIG_EXT_HTTPS_PORT:-8443)", 25 | 26 | # Configure this to enable SSL and generate snakeoil keys for the given domain 27 | CONFIG_EXT_SSL_HOSTNAME: "$(CONFIG_EXT_SSL_HOSTNAME:-)", 28 | 29 | # Create additional configuration variables here. Start them with "CONFIG_" 30 | # so they can be easily identified... 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /baseimage/setup/apps/etc/skel/clone/build.sh.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Created by chaplocal on %(`date`) 3 | # 4 | # Used to create a new derivative image with %(PARENT_IMAGE) as its base. You can 5 | # also just use 'docker build' directly if you wish. If you don't use this script, 6 | # you need to be sure that etc/version.inc contains the proper baseimage name. 7 | # Launchers and other scripts rely upon this. 8 | 9 | # the cd trick assures this works even if the current directory is not current. 10 | cd ${0%/*} 11 | 12 | if [ "$CHAP_SERVICE_NAME" != "" ]; then 13 | echo You need to run build.sh on your docker host, not inside a container. 14 | exit 15 | fi 16 | 17 | # Uncomment to default to your new derivative image name... 18 | #prodimage="%(PARENT_IMAGE:|%(IMAGE_NAMESPACE)/*|%(PARENT_IMAGE:/^%(IMAGE_NAMESPACE)/mylocal/)|%(PARENT_IMAGE))" 19 | 20 | [ "$1" != "" ] && prodimage="$1" 21 | 22 | if [ "$prodimage" == "" ]; then 23 | echo "Usage: ./build.sh " 24 | exit 1 25 | else 26 | echo Building "$prodimage" ... 27 | fi 28 | 29 | if [ ! -f Dockerfile ]; then 30 | echo "Expecting to find Dockerfile in current directory ... not found!" 31 | exit 1 32 | fi 33 | 34 | # Update the image information for the new build so that the derivative image is the baseimage 35 | sed "s/^IMAGE_NAME=.*/IMAGE_NAME=${prodimage/\//\\\/}/" build/new_version.inc 36 | 37 | DOCKER_CMD=$(docker version >/dev/null 2>&1 && echo docker || echo 'sudo docker') 38 | $DOCKER_CMD build -t $prodimage . 39 | 40 | # Remove temporary version file 41 | rm -f build/new_version.inc 42 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/css/login.css: -------------------------------------------------------------------------------- 1 | /* LOGIN FORM */ 2 | 3 | body.login { 4 | background: #f8f8f8; 5 | } 6 | 7 | .login #header { 8 | height: auto; 9 | padding: 5px 16px; 10 | } 11 | 12 | .login #header h1 { 13 | font-size: 18px; 14 | } 15 | 16 | .login #header h1 a { 17 | color: #fff; 18 | } 19 | 20 | .login #content { 21 | padding: 20px 20px 0; 22 | } 23 | 24 | .login #container { 25 | background: #fff; 26 | border: 1px solid #eaeaea; 27 | border-radius: 4px; 28 | overflow: hidden; 29 | width: 28em; 30 | min-width: 300px; 31 | margin: 100px auto; 32 | } 33 | 34 | .login #content-main { 35 | width: 100%; 36 | } 37 | 38 | .login .form-row { 39 | padding: 4px 0; 40 | float: left; 41 | width: 100%; 42 | border-bottom: none; 43 | } 44 | 45 | .login .form-row label { 46 | padding-right: 0.5em; 47 | line-height: 2em; 48 | font-size: 1em; 49 | clear: both; 50 | color: #333; 51 | } 52 | 53 | .login .form-row #id_username, .login .form-row #id_password { 54 | clear: both; 55 | padding: 8px; 56 | width: 100%; 57 | -webkit-box-sizing: border-box; 58 | -moz-box-sizing: border-box; 59 | box-sizing: border-box; 60 | } 61 | 62 | .login span.help { 63 | font-size: 10px; 64 | display: block; 65 | } 66 | 67 | .login .submit-row { 68 | clear: both; 69 | padding: 1em 0 0 9.4em; 70 | margin: 0; 71 | border: none; 72 | background: none; 73 | text-align: left; 74 | } 75 | 76 | .login .password-reset-link { 77 | text-align: center; 78 | } 79 | -------------------------------------------------------------------------------- /baseimage/setup/create-binaries.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is NOT run during the docker image build, but is here for convenience because it is part of 4 | # a pre-build setp. Some installations require gcc and all the development tools, which adds 100MB or 5 | # more to the image! Hate that! So, what we do in the Makefile is this: 6 | # 7 | # docker run -i ubuntu:14.04 --rm=true image/setup/binaries.out 8 | # 9 | # It runs a separate container, builds the binary packages, then includees them in a root-extractable 10 | # bundle. Since this is the same architecture as used by the image build, all should be compatible. 11 | 12 | # Find our absolute directory so we can mount ./setup 13 | cd ${0%/*}/.. 14 | absdir=$PWD 15 | echo $absdir 16 | 17 | zflag=$(sestatus 2>/dev/null | fgrep -q enabled && echo :z) 18 | docker run -i -v $absdir/setup:/setup$zflag --rm=true ubuntu:14.04 /bin/bash <<"EOF" 19 | 20 | # Obtain UID of the mounted volume so we don't copy as root 21 | uid=`ls -l / | awk '/setup$/{print $3}'` 22 | useradd -u $uid usetup 23 | 24 | # Use a proxy if we have one 25 | /setup/apt_setproxy on 26 | 27 | echo Install all development tools... 28 | apt-get update 29 | apt-get install -y git python3-dev 30 | 31 | echo Build binary versions of needed modules... 32 | mkdir /build 33 | git clone https://github.com/dvarrazzo/py-setproctitle.git 34 | cd py-setproctitle 35 | python3 setup.py bdist 36 | 37 | ls -lR dist 38 | echo Copy them to our shared mount bin... 39 | cd dist 40 | su usetup -c 'mkdir -p /setup/lib; cp -v setproctitle-*.gz /setup/lib/setproctitle-install.tar.gz' 41 | 42 | EOF 43 | -------------------------------------------------------------------------------- /baseimage/tests/inetd-baseimage.elt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env expect-test-command 2 | 3 | @5 4 | 5 | # First use get-chaplocal to set up a new development environment 6 | 7 | >TASK get-chaplocal | sh 8 | ./chaplocal inetd 11 | ls -l 17 | exit 20 | 21 | # Now, create a new interactive script that we can run with inetd, and 22 | # add the script to start it 23 | 24 | >cd inetd; ./run.sh 25 | >cat >echotest 26 | >>#!/usr/bin/python3 27 | >>import sys 28 | >>for line in sys.stdin: 29 | >> if "EXIT" in line: 30 | >> exit(0) 31 | >> print("Echoing: ", line) 32 | >> sys.stdout.flush() 33 | >>^D 34 | >chmod 755 echotest 35 | >echo 'inetd_test.service: { type: inetd, port: 9876, command: "$(APPS_DIR)/echotest" }' >chaperone.d/inetd.conf 36 | >exit 37 | >./run.sh 38 | telchap status 40 | exit 42 | ./run.sh -d -n inetd-test-container -p 9876:9876 46 | >sleep 3; telnet localhost 9876 47 | >>Now is the time for all good men 48 | >AGAIN 50 | >EXIT 52 | docker stop inetd-test-container 54 | docker rm -v inetd-test-container 56 | TASK get-chaplocal | sh 8 | ./chaplocal inetd 11 | ls -l 17 | exit 20 | 21 | # Now, create a new interactive script that we can run with inetd, and 22 | # add the script to start it 23 | 24 | >cd inetd; ./run.sh 25 | >cat >echotest 26 | >>#!/usr/bin/python3 27 | >>import sys 28 | >>for line in sys.stdin: 29 | >> if "EXIT" in line: 30 | >> exit(0) 31 | >> print("Echoing: ", line) 32 | >> sys.stdout.flush() 33 | >>^D 34 | >chmod 755 echotest 35 | >echo 'inetd_test.service: { type: inetd, port: 9876, command: "$(APPS_DIR)/echotest" }' >chaperone.d/inetd.conf 36 | >exit 37 | >./run.sh 38 | telchap status 40 | exit 42 | ./run.sh -d -n inetd-test-container -p 9876:9876 46 | >sleep 3; telnet localhost 9876 47 | >>Now is the time for all good men 48 | >AGAIN 50 | >EXIT 52 | docker stop inetd-test-container 54 | docker rm -v inetd-test-container 56 | image/setup/binaries.out 8 | # 9 | # It runs a separate container, builds the binary packages, then includees them in a root-extractable 10 | # bundle. Since this is the same architecture as used by the image build, all should be compatible. 11 | 12 | # Find our absolute directory so we can mount ./setup 13 | cd ${0%/*}/.. 14 | absdir=$PWD 15 | echo $absdir 16 | 17 | zflag=$(sestatus 2>/dev/null | fgrep -q enabled && echo :z) 18 | docker run -i -v $absdir/setup:/setup$zflag --rm=true ubuntu:14.04 /bin/bash <<"EOF" 19 | 20 | # Obtain UID of the mounted volume so we don't copy as root 21 | uid=`ls -l / | awk '/setup$/{print $3}'` 22 | useradd -u $uid usetup 23 | 24 | # Use a proxy if we have one 25 | /setup/apt_setproxy on 26 | 27 | echo Install all development tools... 28 | apt-get update 29 | apt-get install -y curl python3-dev python3-pip 30 | 31 | echo Build binary versions of needed modules... 32 | mkdir /build 33 | curl -SL https://github.com/unbit/uwsgi/archive/2.0.12.tar.gz | tar xzf - 34 | cd uwsgi-2.0.12 35 | python3 setup.py bdist 36 | 37 | ls -lR dist 38 | echo Copy them to our shared mount bin... 39 | cd dist 40 | su usetup -c 'mkdir -p /setup/lib; cp -v uWSGI-*.gz /setup/lib/uwsgi-install.tar.gz' 41 | 42 | EOF 43 | -------------------------------------------------------------------------------- /lemp/setup/nginx_signing.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v1.4.11 (FreeBSD) 3 | 4 | mQENBE5OMmIBCAD+FPYKGriGGf7NqwKfWC83cBV01gabgVWQmZbMcFzeW+hMsgxH 5 | W6iimD0RsfZ9oEbfJCPG0CRSZ7ppq5pKamYs2+EJ8Q2ysOFHHwpGrA2C8zyNAs4I 6 | QxnZZIbETgcSwFtDun0XiqPwPZgyuXVm9PAbLZRbfBzm8wR/3SWygqZBBLdQk5TE 7 | fDR+Eny/M1RVR4xClECONF9UBB2ejFdI1LD45APbP2hsN/piFByU1t7yK2gpFyRt 8 | 97WzGHn9MV5/TL7AmRPM4pcr3JacmtCnxXeCZ8nLqedoSuHFuhwyDnlAbu8I16O5 9 | XRrfzhrHRJFM1JnIiGmzZi6zBvH0ItfyX6ttABEBAAG0KW5naW54IHNpZ25pbmcg 10 | a2V5IDxzaWduaW5nLWtleUBuZ2lueC5jb20+iQE+BBMBAgAoBQJOTjJiAhsDBQkJ 11 | ZgGABgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRCr9b2Ce9m/YpvjB/98uV4t 12 | 94d0oEh5XlqEZzVMrcTgPQ3BZt05N5xVuYaglv7OQtdlErMXmRWaFZEqDaMHdniC 13 | sF63jWMd29vC4xpzIfmsLK3ce9oYo4t9o4WWqBUdf0Ff1LMz1dfLG2HDtKPfYg3C 14 | 8NESud09zuP5NohaE8Qzj/4p6rWDiRpuZ++4fnL3Dt3N6jXILwr/TM/Ma7jvaXGP 15 | DO3kzm4dNKp5b5bn2nT2QWLPnEKxvOg5Zoej8l9+KFsUnXoWoYCkMQ2QTpZQFNwF 16 | xwJGoAz8K3PwVPUrIL6b1lsiNovDgcgP0eDgzvwLynWKBPkRRjtgmWLoeaS9FAZV 17 | ccXJMmANXJFuCf26iQEcBBABAgAGBQJOTkelAAoJEKZP1bF62zmo79oH/1XDb29S 18 | YtWp+MTJTPFEwlWRiyRuDXy3wBd/BpwBRIWfWzMs1gnCjNjk0EVBVGa2grvy9Jtx 19 | JKMd6l/PWXVucSt+U/+GO8rBkw14SdhqxaS2l14v6gyMeUrSbY3XfToGfwHC4sa/ 20 | Thn8X4jFaQ2XN5dAIzJGU1s5JA0tjEzUwCnmrKmyMlXZaoQVrmORGjCuH0I0aAFk 21 | RS0UtnB9HPpxhGVbs24xXZQnZDNbUQeulFxS4uP3OLDBAeCHl+v4t/uotIad8v6J 22 | SO93vc1evIje6lguE81HHmJn9noxPItvOvSMb2yPsE8mH4cJHRTFNSEhPW6ghmlf 23 | Wa9ZwiVX5igxcvaIRgQQEQIABgUCTk5b0gAKCRDs8OkLLBcgg1G+AKCnacLb/+W6 24 | cflirUIExgZdUJqoogCeNPVwXiHEIVqithAM1pdY/gcaQZmIRgQQEQIABgUCTk5f 25 | YQAKCRCpN2E5pSTFPnNWAJ9gUozyiS+9jf2rJvqmJSeWuCgVRwCcCUFhXRCpQO2Y 26 | Va3l3WuB+rgKjsQ= 27 | =A015 28 | -----END PGP PUBLIC KEY BLOCK----- 29 | -------------------------------------------------------------------------------- /baseimage/setup/apps/bin/sample_app: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # A sample app which displays relevant information on the screen, just so new users 3 | # know what's going on 4 | 5 | echo "" 6 | echo "********************" 7 | echo "NOTE: This is output from $APPS_DIR/sample_app" 8 | echo " (A user application sample.)" 9 | echo "" 10 | echo "You can disable this application, or replace it with your own by examining" 11 | echo "the $APPS_DIR/chaperone.d/200-userapp.conf configuration file." 12 | echo "" 13 | 14 | if [ "$USER" != 'runapps' ]; then 15 | echo "Your container is running as user '$USER'. This most likely means that your" 16 | echo "application directory is shared with your host for easy development." 17 | else 18 | echo "Your container is running as '$USER'. This looks like a production environment" 19 | echo "and all configuration is stored within the container's filesystem". 20 | fi 21 | 22 | # See if there is a console app running... 23 | CONSOLE_STATUS=`telchap status | awk '/CONSOLE/{print $4}'` 24 | 25 | if [ "$CONSOLE_STATUS" != 'starting' ]; then 26 | echo "" 27 | if [ "$INTERACTIVE" == '1' ]; then 28 | echo "You're running interactively, but there is no console application. Perhaps" 29 | echo "you should add /bin/bash to the 'docker run' command line?" 30 | echo "" 31 | echo "Because there is no foreground application, the system may appear to hang," 32 | echo "but it's running. You can type Ctrl-C to stop it." 33 | else 34 | echo "There is no foreground application. Ctrl-C will stop the system, or you" 35 | echo "can get in using 'docker exec container-name /bin/bash" 36 | fi 37 | fi 38 | 39 | echo "" 40 | echo "********************" 41 | 42 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/polls/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import get_object_or_404, render 2 | from django.http import HttpResponseRedirect 3 | from django.core.urlresolvers import reverse 4 | from django.views import generic 5 | 6 | from .models import Choice, Question 7 | 8 | 9 | class IndexView(generic.ListView): 10 | template_name = 'polls/index.html' 11 | context_object_name = 'latest_question_list' 12 | 13 | def get_queryset(self): 14 | """Return the last five published questions.""" 15 | return Question.objects.order_by('-pub_date')[:5] 16 | 17 | 18 | class DetailView(generic.DetailView): 19 | model = Question 20 | template_name = 'polls/detail.html' 21 | 22 | 23 | class ResultsView(generic.DetailView): 24 | model = Question 25 | template_name = 'polls/results.html' 26 | 27 | 28 | def vote(request, question_id): 29 | question = get_object_or_404(Question, pk=question_id) 30 | try: 31 | selected_choice = question.choice_set.get(pk=request.POST['choice']) 32 | except (KeyError, Choice.DoesNotExist): 33 | # Redisplay the question voting form. 34 | return render(request, 'polls/detail.html', { 35 | 'question': question, 36 | 'error_message': "You didn't select a choice.", 37 | }) 38 | else: 39 | selected_choice.votes += 1 40 | selected_choice.save() 41 | # Always return an HttpResponseRedirect after successfully dealing 42 | # with POST data. This prevents data from being posted twice if a 43 | # user hits the Back button. 44 | return HttpResponseRedirect(reverse('polls:results', args=(question.id,))) 45 | -------------------------------------------------------------------------------- /alpinebase/setup/create-binaries.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is NOT run during the docker image build, but is here for convenience because it is part of 4 | # a pre-build setp. Some installations require gcc and all the development tools, which adds 100MB or 5 | # more to the image! Hate that! So, what we do in the Makefile is this: 6 | # 7 | # docker run -i ubuntu:14.04 --rm=true image/setup/binaries.out 8 | # 9 | # It runs a separate container, builds the binary packages, then includees them in a root-extractable 10 | # bundle. Since this is the same architecture as used by the image build, all should be compatible. 11 | 12 | # Find our absolute directory so we can mount ./setup 13 | cd ${0%/*}/.. 14 | absdir=$PWD 15 | echo $absdir 16 | 17 | zflag=$(sestatus 2>/dev/null | fgrep -q enabled && echo :z) 18 | docker run -i -v $absdir/setup:/setup$zflag --rm=true alpine:3.2 /bin/sh <<"EOF" 19 | 20 | # Obtain UID of the mounted volume so we don't copy as root 21 | uid=`ls -l / | awk '/setup$/{print $3}'` 22 | adduser -D -u $uid -s /bin/sh usetup 23 | 24 | echo Install all development tools... 25 | apk add --update python3-dev gcc bash git musl-dev 26 | 27 | # Bit of a hack to make sure prctl.h is found under alpine 28 | cd /usr/include; mkdir linux; cd linux; ln -s /usr/include/sys/prctl.h 29 | 30 | echo Build binary versions of needed modules... 31 | mkdir /build 32 | git clone https://github.com/dvarrazzo/py-setproctitle.git 33 | cd py-setproctitle 34 | python3 setup.py bdist 35 | 36 | echo Copy them to our shared mount bin... 37 | cd dist 38 | su usetup -c 'mkdir -p /setup/lib; cp -v setproctitle-*.gz /setup/lib/setproctitle-install.tar.gz' 39 | 40 | EOF 41 | -------------------------------------------------------------------------------- /include/make.inc: -------------------------------------------------------------------------------- 1 | this_file := $(abspath $(lastword $(MAKEFILE_LIST))) 2 | export TOPLEV_DIR := $(subst /include/make.inc,,$(this_file)) 3 | 4 | # Note that version.inc must be generic and compatible with both shells and Makefiles, 5 | # so it contains nothing fancy. 6 | include $(TOPLEV_DIR)/include/version.inc 7 | 8 | FULLNAME = $(IMAGE_NAMESPACE)/$(BASENAME) 9 | VERSION = $(IMAGE_VERSION)-$(IMAGE_ARCH) 10 | 11 | this_file := $(abspath $(lastword $(MAKEFILE_LIST))) 12 | PATH := $(TOPLEV_DIR)/bin:$(PATH) 13 | 14 | DOCKER_BUILD=\ 15 | echo "IMAGE_NAME=$(FULLNAME)" | cat $(TOPLEV_DIR)/include/version.inc - >setup/this_version.inc; \ 16 | [ -f Dockerfile.tpl ] && sed "s|FROM chapdev/|FROM $(IMAGE_NAMESPACE)/|" Dockerfile; \ 17 | tar czh . | docker build -t $(FULLNAME):$(VERSION) --rm -; docker tag -f $(FULLNAME):$(VERSION) $(FULLNAME):latest; \ 18 | rm -f setup/this_version.inc; \ 19 | [ -f Dockerfile.tpl ] && rm Dockerfile 20 | DOCKER_REBUILD=\ 21 | echo "IMAGE_NAME=$(FULLNAME)" | cat $(TOPLEV_DIR)/include/version.inc - >setup/this_version.inc; \ 22 | [ -f Dockerfile.tpl ] && sed "s|FROM chapdev/|FROM $(IMAGE_NAMESPACE)/|" Dockerfile; \ 23 | tar czh . | docker build -t $(FULLNAME):$(VERSION) --no-cache=true --rm -; docker tag -f $(FULLNAME):$(VERSION) $(FULLNAME):latest; \ 24 | rm -f setup/this_version.inc; \ 25 | [ -f Dockerfile.tpl ] && rm Dockerfile 26 | 27 | RUN_TESTS=test-driver tests $(IMAGE_NAMESPACE) $(BASENAME) $(TOPLEV_DIR)/test_logs 28 | 29 | .PHONY: all build test 30 | 31 | all: build 32 | 33 | build: 34 | $(DOCKER_BUILD) 35 | 36 | rebuild: 37 | $(DOCKER_REBUILD) 38 | 39 | test: 40 | $(RUN_TESTS) 41 | -------------------------------------------------------------------------------- /lamp/setup/apps/www/sites.d/default.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | # The ServerName directive sets the request scheme, hostname and port that 4 | # the server uses to identify itself. 5 | #ServerName www.example.com 6 | 7 | ServerAdmin webmaster@localhost 8 | DocumentRoot ${APACHE_SITES_DIR}/default 9 | 10 | # Errors go to the syslog so they can be duplicated to the console easily 11 | ErrorLog syslog:local1 12 | CustomLog ${APACHE_LOG_DIR}/default-access.log combined 13 | 14 | Alias /phpmyadmin /usr/share/phpmyadmin 15 | 16 | 17 | 18 | 19 | 20 | ServerAdmin webmaster@localhost 21 | DocumentRoot ${APACHE_SITES_DIR}/default 22 | 23 | ErrorLog syslog:local1 24 | CustomLog ${APACHE_LOG_DIR}/ssl-access.log combined 25 | 26 | 27 | SSLEngine on 28 | 29 | # A self-signed (snakeoil) certificate can be created by installing 30 | # the ssl-cert package. See 31 | # /usr/share/doc/apache2/README.Debian.gz for more info. 32 | # If both key and certificate are stored in the same file, only the 33 | # SSLCertificateFile directive is needed. 34 | SSLCertificateFile ${VAR_DIR}/certs/ssl-cert-snakeoil.pem 35 | SSLCertificateKeyFile ${VAR_DIR}/certs/ssl-cert-snakeoil.key 36 | 37 | 38 | SSLOptions +StdEnvVars 39 | 40 | 41 | SSLOptions +StdEnvVars 42 | 43 | 44 | BrowserMatch "MSIE [2-6]" \ 45 | nokeepalive ssl-unclean-shutdown \ 46 | downgrade-1.0 force-response-1.0 47 | # MSIE 7 and newer should be able to use keepalive 48 | BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /bin/test-driver: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Assumes the current directory contains executable files and runs them all. 3 | 4 | function relpath() { python -c "import os; print(os.path.relpath('$1', '$2' or os.curdir))"; } 5 | 6 | TESTDIR=$(readlink -f $1) 7 | TMPDIR=$TESTDIR/_temp_ 8 | IMAGE_NAMESPACE=$2 9 | IMAGE_NAME=$3 10 | LOGDIR=$4 11 | LOGFILE=$LOGDIR/$IMAGE_NAME.log 12 | 13 | export EL_TEST_IMAGE=$IMAGE_NAMESPACE/$IMAGE_NAME 14 | export EL_TEST_NAMESPACE=$IMAGE_NAMESPACE 15 | 16 | if [ ! -d $TESTDIR ]; then 17 | exit 18 | fi 19 | 20 | if [ -e $TMPDIR ]; then 21 | echo "Can't continue... $TMPDIR already exists." 22 | exit 1 23 | fi 24 | 25 | if [ "`which expect-lite`" == "" ]; then 26 | echo "expect-lite must be installed for tests to run" 27 | exit 1 28 | fi 29 | 30 | if [ -f /var/run/docker.pid ]; then 31 | if [[ "`ps --no-headers -p \`cat /var/run/docker.pid\` -o command`" =~ devicemapper ]]; then 32 | export EL_timeout_multiplier=2 # devicemapper takes a long time to destroy an image 33 | fi 34 | fi 35 | 36 | mkdir -p $LOGDIR 37 | 38 | ( 39 | exitcode=0 40 | rm -rf $LOGFILE 41 | for sf in $( find $TESTDIR -type f -executable \! -name '*~' ); do 42 | mkdir $TMPDIR; cd $TMPDIR 43 | echo "Running $IMAGE_NAME - ${sf/*\//}" 44 | echo "Running $IMAGE_NAME - $sf" >>$LOGFILE 45 | if ! $sf >>$LOGFILE 2>&1; then 46 | echo "TEST FAILED: $IMAGE_NAME $sf (see $(relpath $LOGFILE.err $TOPLEV_DIR))" 47 | exitcode=2 48 | fi 49 | cd $TESTDIR; [ ! -f keep.tempdir ] && rm -rf $TMPDIR 50 | done 51 | if [ $exitcode == 0 ]; then 52 | echo "Tests passed for $IMAGE_NAME" 53 | else 54 | if [ -f $LOGFILE ]; then 55 | mv $LOGFILE $LOGFILE.err 56 | fi 57 | fi 58 | exit $exitcode 59 | ) 60 | -------------------------------------------------------------------------------- /baseimage/setup/apps/chaperone.d/200-userapp.conf: -------------------------------------------------------------------------------- 1 | # 200-userapp.conf 2 | # 3 | # This is a sample user applciation file. It runs a simple script which outputs 4 | # information directly to stdout, just so you know it's there. 5 | 6 | settings: { 7 | 8 | env_set: { 9 | 'MY_ENV_VAR': 'You can set global environment variables here.', 10 | } 11 | 12 | } 13 | 14 | # This is a sample oneshot service that runs at IDLE time, just before the console app, if present. 15 | # It will output something so at least something appears on the screen. 16 | 17 | sample.service: { 18 | # This is a oneshot service, but most likely a real applicaton will be another type 19 | # such as 'simple', or 'forking'. 20 | type: oneshot, 21 | enabled: true, # CHANGE TO 'false' so this app doesn't run any more 22 | 23 | # Command output goes directly to stdout instead of to the syslog. 24 | # Note that you normally want to have services output to the syslog, because 25 | # chaperone's logging directives allow you to echo syslog data to stdout. That's 26 | # a better place to control things (see 010-start.conf). 27 | command: "$(APPS_DIR)/bin/sample_app", 28 | stdout: inherit, 29 | 30 | # Because we're in the IDLE group, we will run only after all system services have 31 | # started. However, if there is a command line program, like /bin/bash, we want to 32 | # run before that one. All upper-case group names have special meanings. However, 33 | # You can define your own service groups, then use them to declare startup 34 | # dependencies. 35 | service_groups: "IDLE", 36 | before: "CONSOLE", 37 | 38 | # These environment variables will be added only for your service 39 | env_set: { 40 | 'INTERACTIVE': '$(_CHAP_INTERACTIVE)', 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /nginx-django/setup/apps/chaperone.d/005-config.conf: -------------------------------------------------------------------------------- 1 | # 005-config.conf 2 | # 3 | # Put container configuration variables here. This should strictly be for configuration 4 | # variables that are passed into the container. 100% of container configuraiton should 5 | # be possible by setting these variables here or on the 'docker run' command line. 6 | 7 | settings: { 8 | 9 | env_set: { 10 | 11 | # This is the hostname of the host machine. Generally, this is only needed 12 | # by certain applications (such as those supporting SSL certiifcates, but is common 13 | # enough to include as a standard option. 14 | 15 | CONFIG_EXT_HOSTNAME: "$(CONFIG_EXT_HOSTNAME:-localhost)", 16 | 17 | # HTTP ports of exported ports. These are good policy to define in your "docker run" 18 | # command so that internal applications know what ports the public interfaces are 19 | # visible on. Sometimes this is necessary, such as when appliations push their 20 | # endpoints via API's or when webservers do redirects. The default launchers 21 | # for Chaperone containers handle this for you automatically. 22 | 23 | CONFIG_EXT_HTTP_PORT: "$(CONFIG_EXT_HTTP_PORT:-8080)", 24 | CONFIG_EXT_HTTPS_PORT: "$(CONFIG_EXT_HTTPS_PORT:-8443)", 25 | 26 | # Configure this to enable SSL and generate snakeoil keys for the given domain 27 | CONFIG_EXT_SSL_HOSTNAME: "$(CONFIG_EXT_SSL_HOSTNAME:-)", 28 | 29 | # Generic string to identify this container, used for output such as logs 30 | # or web pages which identify this container. No particular syntax. 31 | CONTAINER_NAME: "nginx+Django", 32 | 33 | # Create additional configuration variables here. Start them with "CONFIG_" 34 | # so they can be easily identified... 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/admin/js/prepopulate.js: -------------------------------------------------------------------------------- 1 | /*global URLify*/ 2 | (function($) { 3 | 'use strict'; 4 | $.fn.prepopulate = function(dependencies, maxLength, allowUnicode) { 5 | /* 6 | Depends on urlify.js 7 | Populates a selected field with the values of the dependent fields, 8 | URLifies and shortens the string. 9 | dependencies - array of dependent fields ids 10 | maxLength - maximum length of the URLify'd string 11 | allowUnicode - Unicode support of the URLify'd string 12 | */ 13 | return this.each(function() { 14 | var prepopulatedField = $(this); 15 | 16 | var populate = function() { 17 | // Bail if the field's value has been changed by the user 18 | if (prepopulatedField.data('_changed')) { 19 | return; 20 | } 21 | 22 | var values = []; 23 | $.each(dependencies, function(i, field) { 24 | field = $(field); 25 | if (field.val().length > 0) { 26 | values.push(field.val()); 27 | } 28 | }); 29 | prepopulatedField.val(URLify(values.join(' '), maxLength, allowUnicode)); 30 | }; 31 | 32 | prepopulatedField.data('_changed', false); 33 | prepopulatedField.change(function() { 34 | prepopulatedField.data('_changed', true); 35 | }); 36 | 37 | if (!prepopulatedField.val()) { 38 | $(dependencies.join(',')).keyup(populate).change(populate).focus(populate); 39 | } 40 | }); 41 | }; 42 | })(django.jQuery); 43 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/chaperone.d/005-config.conf: -------------------------------------------------------------------------------- 1 | # 005-config.conf 2 | # 3 | # Put container configuration variables here. This should strictly be for configuration 4 | # variables that are passed into the container. 100% of container configuraiton should 5 | # be possible by setting these variables here or on the 'docker run' command line. 6 | 7 | settings: { 8 | 9 | env_set: { 10 | 11 | # This is the hostname of the host machine. Generally, this is only needed 12 | # by certain applications (such as those supporting SSL certiifcates, but is common 13 | # enough to include as a standard option. 14 | 15 | CONFIG_EXT_HOSTNAME: "$(CONFIG_EXT_HOSTNAME:-localhost)", 16 | 17 | # HTTP ports of exported ports. These are good policy to define in your "docker run" 18 | # command so that internal applications know what ports the public interfaces are 19 | # visible on. Sometimes this is necessary, such as when appliations push their 20 | # endpoints via API's or when webservers do redirects. The default launchers 21 | # for Chaperone containers handle this for you automatically. 22 | 23 | CONFIG_EXT_HTTP_PORT: "$(CONFIG_EXT_HTTP_PORT:-8080)", 24 | CONFIG_EXT_HTTPS_PORT: "$(CONFIG_EXT_HTTPS_PORT:-8443)", 25 | 26 | # Configure this to enable SSL and generate snakeoil keys for the given domain 27 | CONFIG_EXT_SSL_HOSTNAME: "$(CONFIG_EXT_SSL_HOSTNAME:-)", 28 | 29 | # Generic string to identify this container, used for output such as logs 30 | # or web pages which identify this container. No particular syntax. 31 | CONTAINER_NAME: "nginx+Django", 32 | 33 | # Create additional configuration variables here. Start them with "CONFIG_" 34 | # so they can be easily identified... 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /alpinejava/setup/apps/chaperone.d/200-userapp.conf: -------------------------------------------------------------------------------- 1 | # 200-userapp.conf 2 | # 3 | # This is a sample user applciation file. It runs a simple script which outputs 4 | # information directly to stdout, just so you know it's there. 5 | 6 | settings: { 7 | 8 | env_set: { 9 | 'MY_ENV_VAR': 'You can set global environment variables here.', 10 | } 11 | 12 | } 13 | 14 | # This is a sample oneshot service that runs at IDLE time, just before the console app, if present. 15 | # It will output something so at least something appears on the screen. 16 | 17 | sample.service: { 18 | # This is a oneshot service, but most likely a real applicaton will be another type 19 | # such as 'simple', or 'forking'. 20 | type: oneshot, 21 | enabled: true, # CHANGE TO 'false' so this app doesn't run any more 22 | 23 | # Command output goes directly to stdout instead of to the syslog. 24 | # Note that you normally want to have services output to the syslog, because 25 | # chaperone's logging directives allow you to echo syslog data to stdout. That's 26 | # a better place to control things (see 010-start.conf). 27 | command: "java -classpath $(APPS_DIR)/java_sample SampleApp", 28 | stdout: inherit, 29 | 30 | # Because we're in the IDLE group, we will run only after all system services have 31 | # started. However, if there is a command line program, like /bin/bash, we want to 32 | # run before that one. All upper-case group names have special meanings. However, 33 | # You can define your own service groups, then use them to declare startup 34 | # dependencies. 35 | service_groups: "IDLE", 36 | before: "CONSOLE", 37 | 38 | # These environment variables will be added only for your service 39 | env_set: { 40 | 'INTERACTIVE': '$(_CHAP_INTERACTIVE)', 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /centosbase/setup/create-binaries.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is NOT run during the docker image build, but is here for convenience because it is part of 4 | # a pre-build setp. Some installations require gcc and all the development tools, which adds 100MB or 5 | # more to the image! Hate that! So, what we do in the Makefile is this: 6 | # 7 | # docker run -i ubuntu:14.04 --rm=true image/setup/binaries.out 8 | # 9 | # It runs a separate container, builds the binary packages, then includees them in a root-extractable 10 | # bundle. Since this is the same architecture as used by the image build, all should be compatible. 11 | 12 | # Find our absolute directory so we can mount ./setup 13 | cd ${0%/*}/.. 14 | absdir=$PWD 15 | echo $absdir 16 | 17 | zflag=$(sestatus 2>/dev/null | fgrep -q enabled && echo :z) 18 | docker run -i -v $absdir/setup:/setup$zflag --rm=true centos:7 /bin/sh <<"EOF" 19 | 20 | # Obtain UID of the mounted volume so we don't copy as root 21 | uid=`ls -l / | awk '/setup$/{print $3}'` 22 | useradd -u $uid -s /bin/sh usetup 23 | 24 | echo Install all needed tools... 25 | yum update -y 26 | yum install -y git gcc 27 | 28 | mkdir /build; cd /build 29 | curl -O http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm 30 | rpm -ivh epel-release-* 31 | yum install -y python34 python34-devel 32 | curl -s "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" 33 | python3.4 get-pip.py 34 | 35 | echo Build binary versions of needed modules... 36 | git clone https://github.com/dvarrazzo/py-setproctitle.git 37 | cd py-setproctitle 38 | python3.4 setup.py bdist 39 | 40 | echo Copy them to our shared mount bin... 41 | cd dist 42 | su usetup -c 'mkdir -p /setup/lib; cp -v setproctitle-*.gz /setup/lib/setproctitle-install.tar.gz' 43 | 44 | EOF 45 | -------------------------------------------------------------------------------- /apache/setup/apps/chaperone.d/120-apache2.conf: -------------------------------------------------------------------------------- 1 | # 120-apache2.conf 2 | # 3 | # Start up apache. This is a "simple" service, so chaperone will monitor Apache and restart 4 | # it if necessary. Note that apache2.conf refers to MYSQL_UNIX_PORT (set by 105-mysql.conf) 5 | # to tell PHP where MySQL is running. 6 | # 7 | # In the case where no USER variable is specified, we run as the www-data user. 8 | 9 | settings: { 10 | env_set: { 11 | HTTPD_SERVER_NAME: apache, 12 | } 13 | } 14 | 15 | apache2.service: { 16 | command: "/usr/sbin/apache2 -f $(APPS_DIR)/etc/apache2.conf -DFOREGROUND", 17 | restart: true, 18 | uid: "$(USER:-www-data)", 19 | env_set: { 20 | APACHE_LOCK_DIR: /tmp, 21 | APACHE_PID_FILE: /tmp/apache2.pid, 22 | APACHE_RUN_USER: www-data, 23 | APACHE_RUN_GROUP: www-data, 24 | APACHE_RUN_DIR: "$(VAR_DIR)/run", 25 | APACHE_LOG_DIR: "$(VAR_DIR)/log/apache2", 26 | APACHE_SITES_DIR: "$(APPS_DIR)/www", 27 | }, 28 | # If Apache2 does not require a database, you can leave this out. 29 | after: database, 30 | } 31 | 32 | # Use daily logging (the %d) so that log rotation isn't so important. Logs 33 | # will be created automatically for each day where they are requied. 34 | # See 300-logrotate.conf if you want to enable log rotation as a periodic 35 | # job. Note that chaperone watches for logs which are rotated and will 36 | # automatically open a new file if the old one is rotated. 37 | # 38 | # Write logs either as the USER= user, or as www-data. 39 | 40 | apache2.logging: { 41 | enabled: true, 42 | selector: 'local1.*;*.!err', 43 | file: '$(VAR_DIR)/log/apache2/apache-%d.log', 44 | uid: "$(USER:-www-data)", 45 | } 46 | 47 | apache2.logging: { 48 | enabled: true, 49 | selector: 'local1.err', 50 | stderr: true, 51 | file: '$(VAR_DIR)/log/apache2/error-%d.log', 52 | uid: "$(USER:-www-data)", 53 | } 54 | -------------------------------------------------------------------------------- /apache/setup/apps/www/sites.d/default.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | # The ServerName directive sets the request scheme, hostname and port that 4 | # the server uses to identify itself. 5 | #ServerName www.example.com 6 | 7 | ServerAdmin webmaster@localhost 8 | DocumentRoot ${APACHE_SITES_DIR}/default 9 | 10 | 11 | Options +Includes 12 | DirectoryIndex index.shtml 13 | SetEnv APPS_DIR ${APPS_DIR} 14 | SetEnv VAR_DIR ${VAR_DIR} 15 | SetEnv PAGE_NAME "${HTTPD_SERVER_NAME} container" 16 | 17 | 18 | # Errors go to the syslog so they can be duplicated to the console easily 19 | ErrorLog syslog:local1 20 | CustomLog ${APACHE_LOG_DIR}/default-access.log combined 21 | 22 | 23 | 24 | 25 | 26 | ServerAdmin webmaster@localhost 27 | DocumentRoot ${APACHE_SITES_DIR}/default 28 | 29 | ErrorLog syslog:local1 30 | CustomLog ${APACHE_LOG_DIR}/ssl-access.log combined 31 | 32 | 33 | SSLEngine on 34 | 35 | # A self-signed (snakeoil) certificate can be created by installing 36 | # the ssl-cert package. See 37 | # /usr/share/doc/apache2/README.Debian.gz for more info. 38 | # If both key and certificate are stored in the same file, only the 39 | # SSLCertificateFile directive is needed. 40 | SSLCertificateFile ${VAR_DIR}/certs/ssl-cert-snakeoil.pem 41 | SSLCertificateKeyFile ${VAR_DIR}/certs/ssl-cert-snakeoil.key 42 | 43 | 44 | SSLOptions +StdEnvVars 45 | 46 | 47 | SSLOptions +StdEnvVars 48 | 49 | 50 | BrowserMatch "MSIE [2-6]" \ 51 | nokeepalive ssl-unclean-shutdown \ 52 | downgrade-1.0 force-response-1.0 53 | # MSIE 7 and newer should be able to use keepalive 54 | BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /lamp/setup/apps/chaperone.d/120-apache2.conf: -------------------------------------------------------------------------------- 1 | # 120-apache2.conf 2 | # 3 | # Start up apache. This is a "simple" service, so chaperone will monitor Apache and restart 4 | # it if necessary. Note that apache2.conf refers to MYSQL_UNIX_PORT (set by 105-mysql.conf) 5 | # to tell PHP where MySQL is running. 6 | # 7 | # In the case where no USER variable is specified, we run as the www-data user. 8 | 9 | settings: { 10 | env_set: { 11 | HTTPD_SERVER_NAME: apache, 12 | PHPRC: "$(APPS_DIR)/etc/php-cli.ini", 13 | } 14 | } 15 | 16 | apache2.service: { 17 | command: "/usr/sbin/apache2 -f $(APPS_DIR)/etc/apache2.conf -DFOREGROUND", 18 | restart: true, 19 | uid: "$(USER:-www-data)", 20 | env_set: { 21 | APACHE_LOCK_DIR: /tmp, 22 | APACHE_PID_FILE: /tmp/apache2.pid, 23 | APACHE_RUN_USER: www-data, 24 | APACHE_RUN_GROUP: www-data, 25 | APACHE_RUN_DIR: "$(VAR_DIR)/run", 26 | APACHE_LOG_DIR: "$(VAR_DIR)/log/apache2", 27 | APACHE_SITES_DIR: "$(APPS_DIR)/www", 28 | }, 29 | env_unset: [ 'PHPRC' ], 30 | # If Apache2 does not require a database, you can leave this out. 31 | after: database, 32 | } 33 | 34 | # Use daily logging (the %d) so that log rotation isn't so important. Logs 35 | # will be created automatically for each day where they are requied. 36 | # See 300-logrotate.conf if you want to enable log rotation as a periodic 37 | # job. Note that chaperone watches for logs which are rotated and will 38 | # automatically open a new file if the old one is rotated. 39 | # 40 | # Write logs either as the USER= user, or as www-data. 41 | 42 | apache2.logging: { 43 | enabled: true, 44 | selector: 'local1.*;*.!err', 45 | file: '$(VAR_DIR)/log/apache2/apache-%d.log', 46 | uid: "$(USER:-www-data)", 47 | } 48 | 49 | apache2.logging: { 50 | enabled: true, 51 | selector: 'local1.err', 52 | stderr: true, 53 | file: '$(VAR_DIR)/log/apache2/error-%d.log', 54 | uid: "$(USER:-www-data)", 55 | } 56 | -------------------------------------------------------------------------------- /lamp/setup/apps/www/default/images/chaplogo-150627.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /apache/setup/apps/www/default/images/chaplogo-150627.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/www/default/images/chaplogo-150627.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/static/chapinfo/images/chaplogo-150627.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/www/django_sample/chapinfo/static/chapinfo/images/chaplogo-150627.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /alpinebase/setup/apps/etc/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # A quick script to initialize the system. This is not equivalent 3 | # to the classic /etc/init.d type initailization, but more of a preparation 4 | # phase so that services have what they need to run. 5 | 6 | # We publish two variables for use in startup scripts: 7 | # 8 | # CONTAINER_INIT=1 if we are initializing the container for the first time 9 | # VAR_INIT=1 if we are initializing the $VAR_DIR for the first time 10 | # 11 | # Both may be relevant, since it's possible that the $VAR_DIR may be on a mount point 12 | # so it can be reused when starting up containers which refer to it. 13 | 14 | function dolog() { logger -t startup.sh -p info $*; } 15 | function critlog() { logger -t startup.sh -p crit $*; } 16 | 17 | var_setup_file="$VAR_DIR/run/var_setup.done" 18 | cont_setup_file="/container_setup.done" 19 | 20 | export CONTAINER_INIT=0 21 | export VAR_INIT=0 22 | 23 | # Assure anything lingering that might interfere with restart is gone 24 | rm -rf /tmp/*.pid /tmp/*.sock 25 | 26 | if [ ! -f $cont_setup_file ]; then 27 | dolog "initializing container for the first time" 28 | CONTAINER_INIT=1 29 | sudo bash -c "date >$cont_setup_file" 30 | fi 31 | 32 | if [ ! -f $var_setup_file ]; then 33 | dolog "initializing $VAR_DIR for the first time" 34 | VAR_INIT=1 35 | mkdir -p $VAR_DIR >&/dev/null 36 | if [ ! -w $VAR_DIR ]; then 37 | critlog "$VAR_DIR is not writable by user '$USER' -- cannot complete set-up" 38 | exit 1 39 | fi 40 | mkdir -p $VAR_DIR/run $VAR_DIR/log 41 | chmod 777 $VAR_DIR/run $VAR_DIR/log 42 | date >$var_setup_file 43 | fi 44 | 45 | if [ -d $APPS_DIR/startup.d ]; then 46 | for sf in $( find $APPS_DIR/startup.d -type f -perm +100 \! -name '*~' | sort ); do 47 | dolog "running $sf..." 48 | $sf 49 | done 50 | fi 51 | 52 | if [ "$SECURE_ROOT" == "1" -a $CONTAINER_INIT == 1 ]; then 53 | dolog locking down root account 54 | sudo passwd -l root 55 | sudo sed '/NOPASSWD/ d' -i /etc/sudoers 56 | fi 57 | -------------------------------------------------------------------------------- /baseimage/setup/apps/bin/get-chaplocal: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$CHAP_SERVICE_NAME" != "" ]; then 4 | stty -onlcr 2>/dev/null # inhibits carriage return if -t was specified 5 | fi 6 | 7 | if [ "$CHAP_TASK_MODE" != "1" ]; then 8 | echo "get-chaplocal' should only be run in chaperone --task mode from the docker host" 9 | exit 1 10 | fi 11 | 12 | source $APPS_DIR/etc/version.inc 13 | 14 | if [ "$IMAGE_NAME" == "" ]; then 15 | script_text=`cat $APPS_DIR/bin/chaplocal` 16 | else 17 | script_text=`sed "s|chapdev/chaperone-baseimage|$IMAGE_NAME|" $APPS_DIR/bin/chaplocal` 18 | fi 19 | 20 | 21 | cat </dev/null 34 | exit 1 35 | fi 36 | cat >chaplocal <<'-QEOF-' 37 | $script_text 38 | -QEOF- 39 | chmod ugo+x chaplocal 40 | echo "" 41 | echo "The 'chaplocal' script is ready to use. Here is the help you get if you type" 42 | echo " ./chaplocal" 43 | echo "at the command line..." 44 | ./chaplocal 45 | ################################################################################# 46 | # 47 | # YOU SHOULD NOT BE SEEING THIS!!!!!!!!! IF SO, YOU ARE NOT PIPING INTO sh! 48 | # 49 | # Make sure you pipe the output of your docker command into sh, like this... 50 | # 51 | # docker run -i chapdev/chaperone-baseimage --command get-chaplocal | sh 52 | # ^^^^ 53 | ################################################################################# 54 | EOF 55 | -------------------------------------------------------------------------------- /apache/setup/apps/etc/skel/launcher/run-IMAGE.sh.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Extracted from %(PARENT_IMAGE) on %(`date`) 3 | 4 | # Run as interactive: ./%(DEFAULT_LAUNCHER) [options) 5 | # or daemon: ./%(DEFAULT_LAUNCHER) -d [options) 6 | 7 | IMAGE="%(PARENT_IMAGE)" 8 | INTERACTIVE_SHELL="/bin/bash" 9 | 10 | # You can specify the external host and ports for Apache here. These variables 11 | # are also passed into the container so that any application code which does redirects 12 | # can use these if need be. 13 | 14 | EXT_HOSTNAME=%(CONFIG_EXT_HOSTNAME:-localhost) 15 | EXT_HTTP_PORT=%(CONFIG_EXT_HTTP_PORT:-8080) 16 | EXT_HTTPS_PORT=%(CONFIG_EXT_HTTPS_PORT:-8443) 17 | 18 | # Uncomment to enable SSL and specify the certificate hostname 19 | #EXT_SSL_HOSTNAME=secure.example.com 20 | 21 | PORTOPT="-p $EXT_HTTP_PORT:8080 -p $EXT_HTTPS_PORT:8443" 22 | 23 | # If this directory exists and is writable, then it will be used 24 | # as attached storage 25 | STORAGE_LOCATION="$PWD/%(IMAGE_BASENAME)-storage" 26 | STORAGE_USER="$USER" 27 | 28 | # The rest should be OK... 29 | 30 | if [ "$1" == '-d' ]; then 31 | shift 32 | docker_opt="-d $PORTOPT" 33 | INTERACTIVE_SHELL="" 34 | else 35 | docker_opt="-t -i -e TERM=$TERM --rm=true $PORTOPT" 36 | fi 37 | 38 | docker_opt="$docker_opt \ 39 | -e CONFIG_EXT_HOSTNAME=$EXT_HOSTNAME \ 40 | -e CONFIG_EXT_HTTPS_PORT=$EXT_HTTPS_PORT \ 41 | -e CONFIG_EXT_HTTP_PORT=$EXT_HTTP_PORT" 42 | 43 | [ "$EXT_SSL_HOSTNAME" != "" ] && docker_opt="$docker_opt -e CONFIG_EXT_SSL_HOSTNAME=$EXT_SSL_HOSTNAME" 44 | 45 | if [ "$STORAGE_LOCATION" != "" -a -d "$STORAGE_LOCATION" -a -w "$STORAGE_LOCATION" ]; then 46 | SELINUX_FLAG=$(sestatus 2>/dev/null | fgrep -q enabled && echo :z) 47 | docker_opt="$docker_opt -v $STORAGE_LOCATION:/apps/var$SELINUX_FLAG" 48 | chap_opt="--create $STORAGE_USER:/apps/var" 49 | echo Using attached storage at $STORAGE_LOCATION 50 | fi 51 | 52 | # Determine if we need to use 'sudo' 53 | DOCKER_CMD=$(docker version >/dev/null 2>&1 && echo docker || echo 'sudo docker') 54 | 55 | $DOCKER_CMD run $docker_opt $IMAGE $chap_opt $* $INTERACTIVE_SHELL 56 | -------------------------------------------------------------------------------- /lamp/setup/apps/etc/skel/launcher/run-IMAGE.sh.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Extracted from %(PARENT_IMAGE) on %(`date`) 3 | 4 | # Run as interactive: ./%(DEFAULT_LAUNCHER) [options] 5 | # or daemon: ./%(DEFAULT_LAUNCHER) -d [options] 6 | 7 | IMAGE="%(PARENT_IMAGE)" 8 | INTERACTIVE_SHELL="/bin/bash" 9 | 10 | # You can specify the external host and ports for Apache here. These variables 11 | # are also passed into the container so that any application code which does redirects 12 | # can use these if need be. 13 | 14 | EXT_HOSTNAME=%(CONFIG_EXT_HOSTNAME:-localhost) 15 | EXT_HTTP_PORT=%(CONFIG_EXT_HTTP_PORT:-8080) 16 | EXT_HTTPS_PORT=%(CONFIG_EXT_HTTPS_PORT:-8443) 17 | 18 | # Uncomment to enable SSL and specify the certificate hostname 19 | #EXT_SSL_HOSTNAME=secure.example.com 20 | 21 | PORTOPT="-p $EXT_HTTP_PORT:8080 -p $EXT_HTTPS_PORT:8443" 22 | 23 | # If this directory exists and is writable, then it will be used 24 | # as attached storage 25 | STORAGE_LOCATION="$PWD/%(IMAGE_BASENAME)-storage" 26 | STORAGE_USER="$USER" 27 | 28 | # The rest should be OK... 29 | 30 | if [ "$1" == '-d' ]; then 31 | shift 32 | docker_opt="-d $PORTOPT" 33 | INTERACTIVE_SHELL="" 34 | else 35 | docker_opt="-t -i -e TERM=$TERM --rm=true $PORTOPT" 36 | fi 37 | 38 | docker_opt="$docker_opt \ 39 | -e CONFIG_EXT_HOSTNAME=$EXT_HOSTNAME \ 40 | -e CONFIG_EXT_HTTPS_PORT=$EXT_HTTPS_PORT \ 41 | -e CONFIG_EXT_HTTP_PORT=$EXT_HTTP_PORT" 42 | 43 | [ "$EXT_SSL_HOSTNAME" != "" ] && docker_opt="$docker_opt -e CONFIG_EXT_SSL_HOSTNAME=$EXT_SSL_HOSTNAME" 44 | 45 | if [ "$STORAGE_LOCATION" != "" -a -d "$STORAGE_LOCATION" -a -w "$STORAGE_LOCATION" ]; then 46 | SELINUX_FLAG=$(sestatus 2>/dev/null | fgrep -q enabled && echo :z) 47 | docker_opt="$docker_opt -v $STORAGE_LOCATION:/apps/var$SELINUX_FLAG" 48 | chap_opt="--create $STORAGE_USER:/apps/var" 49 | echo Using attached storage at $STORAGE_LOCATION 50 | fi 51 | 52 | # Determine if we need to use 'sudo' 53 | DOCKER_CMD=$(docker version >/dev/null 2>&1 && echo docker || echo 'sudo docker') 54 | 55 | $DOCKER_CMD run $docker_opt $IMAGE $chap_opt $* $INTERACTIVE_SHELL 56 | -------------------------------------------------------------------------------- /lemp/setup/apps/etc/skel/launcher/run-IMAGE.sh.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Extracted from %(PARENT_IMAGE) on %(`date`) 3 | 4 | # Run as interactive: ./%(DEFAULT_LAUNCHER) [options] 5 | # or daemon: ./%(DEFAULT_LAUNCHER) -d [options] 6 | 7 | IMAGE="%(PARENT_IMAGE)" 8 | INTERACTIVE_SHELL="/bin/bash" 9 | 10 | # You can specify the external host and ports for Nginx here. These variables 11 | # are also passed into the container so that any application code which does redirects 12 | # can use these if need be. 13 | 14 | EXT_HOSTNAME=%(CONFIG_EXT_HOSTNAME:-localhost) 15 | EXT_HTTP_PORT=%(CONFIG_EXT_HTTP_PORT:-8080) 16 | EXT_HTTPS_PORT=%(CONFIG_EXT_HTTPS_PORT:-8443) 17 | 18 | # Uncomment to enable SSL and specify the certificate hostname 19 | #EXT_SSL_HOSTNAME=secure.example.com 20 | 21 | PORTOPT="-p $EXT_HTTP_PORT:8080 -p $EXT_HTTPS_PORT:8443" 22 | 23 | # If this directory exists and is writable, then it will be used 24 | # as attached storage 25 | STORAGE_LOCATION="$PWD/%(IMAGE_BASENAME)-storage" 26 | STORAGE_USER="$USER" 27 | 28 | # The rest should be OK... 29 | 30 | if [ "$1" == '-d' ]; then 31 | shift 32 | docker_opt="-d $PORTOPT" 33 | INTERACTIVE_SHELL="" 34 | else 35 | docker_opt="-t -i -e TERM=$TERM --rm=true $PORTOPT" 36 | fi 37 | 38 | docker_opt="$docker_opt \ 39 | -e CONFIG_EXT_HOSTNAME=$EXT_HOSTNAME \ 40 | -e CONFIG_EXT_HTTPS_PORT=$EXT_HTTPS_PORT \ 41 | -e CONFIG_EXT_HTTP_PORT=$EXT_HTTP_PORT" 42 | 43 | [ "$EXT_SSL_HOSTNAME" != "" ] && docker_opt="$docker_opt -e CONFIG_EXT_SSL_HOSTNAME=$EXT_SSL_HOSTNAME" 44 | 45 | if [ "$STORAGE_LOCATION" != "" -a -d "$STORAGE_LOCATION" -a -w "$STORAGE_LOCATION" ]; then 46 | SELINUX_FLAG=$(sestatus 2>/dev/null | fgrep -q enabled && echo :z) 47 | docker_opt="$docker_opt -v $STORAGE_LOCATION:/apps/var$SELINUX_FLAG" 48 | chap_opt="--create $STORAGE_USER:/apps/var" 49 | echo Using attached storage at $STORAGE_LOCATION 50 | fi 51 | 52 | # Determine if we need to use 'sudo' 53 | DOCKER_CMD=$(docker version >/dev/null 2>&1 && echo docker || echo 'sudo docker') 54 | 55 | $DOCKER_CMD run $docker_opt $IMAGE $chap_opt $* $INTERACTIVE_SHELL 56 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/etc/skel/launcher/run-IMAGE.sh.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Extracted from %(PARENT_IMAGE) on %(`date`) 3 | 4 | # Run as interactive: ./%(DEFAULT_LAUNCHER) [options] 5 | # or daemon: ./%(DEFAULT_LAUNCHER) -d [options] 6 | 7 | IMAGE="%(PARENT_IMAGE)" 8 | INTERACTIVE_SHELL="/bin/bash" 9 | 10 | # You can specify the external host and ports for Nginx here. These variables 11 | # are also passed into the container so that any application code which does redirects 12 | # can use these if need be. 13 | 14 | EXT_HOSTNAME=%(CONFIG_EXT_HOSTNAME:-localhost) 15 | EXT_HTTP_PORT=%(CONFIG_EXT_HTTP_PORT:-8080) 16 | EXT_HTTPS_PORT=%(CONFIG_EXT_HTTPS_PORT:-8443) 17 | 18 | # Uncomment to enable SSL and specify the certificate hostname 19 | #EXT_SSL_HOSTNAME=secure.example.com 20 | 21 | PORTOPT="-p $EXT_HTTP_PORT:8080 -p $EXT_HTTPS_PORT:8443" 22 | 23 | # If this directory exists and is writable, then it will be used 24 | # as attached storage 25 | STORAGE_LOCATION="$PWD/%(IMAGE_BASENAME)-storage" 26 | STORAGE_USER="$USER" 27 | 28 | # The rest should be OK... 29 | 30 | if [ "$1" == '-d' ]; then 31 | shift 32 | docker_opt="-d $PORTOPT" 33 | INTERACTIVE_SHELL="" 34 | else 35 | docker_opt="-t -i -e TERM=$TERM --rm=true $PORTOPT" 36 | fi 37 | 38 | docker_opt="$docker_opt \ 39 | -e CONFIG_EXT_HOSTNAME=$EXT_HOSTNAME \ 40 | -e CONFIG_EXT_HTTPS_PORT=$EXT_HTTPS_PORT \ 41 | -e CONFIG_EXT_HTTP_PORT=$EXT_HTTP_PORT" 42 | 43 | [ "$EXT_SSL_HOSTNAME" != "" ] && docker_opt="$docker_opt -e CONFIG_EXT_SSL_HOSTNAME=$EXT_SSL_HOSTNAME" 44 | 45 | if [ "$STORAGE_LOCATION" != "" -a -d "$STORAGE_LOCATION" -a -w "$STORAGE_LOCATION" ]; then 46 | SELINUX_FLAG=$(sestatus 2>/dev/null | fgrep -q enabled && echo :z) 47 | docker_opt="$docker_opt -v $STORAGE_LOCATION:/apps/var$SELINUX_FLAG" 48 | chap_opt="--create $STORAGE_USER:/apps/var" 49 | echo Using attached storage at $STORAGE_LOCATION 50 | fi 51 | 52 | # Determine if we need to use 'sudo' 53 | DOCKER_CMD=$(docker version >/dev/null 2>&1 && echo docker || echo 'sudo docker') 54 | 55 | $DOCKER_CMD run $docker_opt $IMAGE $chap_opt $* $INTERACTIVE_SHELL 56 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/etc/skel/launcher/run-IMAGE.sh.tpl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #Extracted from %(PARENT_IMAGE) on %(`date`) 3 | 4 | # Run as interactive: ./%(DEFAULT_LAUNCHER) [options] 5 | # or daemon: ./%(DEFAULT_LAUNCHER) -d [options] 6 | 7 | IMAGE="%(PARENT_IMAGE)" 8 | INTERACTIVE_SHELL="/bin/bash" 9 | 10 | # You can specify the external host and ports for Nginx here. These variables 11 | # are also passed into the container so that any application code which does redirects 12 | # can use these if need be. 13 | 14 | EXT_HOSTNAME=%(CONFIG_EXT_HOSTNAME:-localhost) 15 | EXT_HTTP_PORT=%(CONFIG_EXT_HTTP_PORT:-8080) 16 | EXT_HTTPS_PORT=%(CONFIG_EXT_HTTPS_PORT:-8443) 17 | 18 | # Uncomment to enable SSL and specify the certificate hostname 19 | #EXT_SSL_HOSTNAME=secure.example.com 20 | 21 | PORTOPT="-p $EXT_HTTP_PORT:8080 -p $EXT_HTTPS_PORT:8443" 22 | 23 | # If this directory exists and is writable, then it will be used 24 | # as attached storage 25 | STORAGE_LOCATION="$PWD/%(IMAGE_BASENAME)-storage" 26 | STORAGE_USER="$USER" 27 | 28 | # The rest should be OK... 29 | 30 | if [ "$1" == '-d' ]; then 31 | shift 32 | docker_opt="-d $PORTOPT" 33 | INTERACTIVE_SHELL="" 34 | else 35 | docker_opt="-t -i -e TERM=$TERM --rm=true $PORTOPT" 36 | fi 37 | 38 | docker_opt="$docker_opt \ 39 | -e CONFIG_EXT_HOSTNAME=$EXT_HOSTNAME \ 40 | -e CONFIG_EXT_HTTPS_PORT=$EXT_HTTPS_PORT \ 41 | -e CONFIG_EXT_HTTP_PORT=$EXT_HTTP_PORT" 42 | 43 | [ "$EXT_SSL_HOSTNAME" != "" ] && docker_opt="$docker_opt -e CONFIG_EXT_SSL_HOSTNAME=$EXT_SSL_HOSTNAME" 44 | 45 | if [ "$STORAGE_LOCATION" != "" -a -d "$STORAGE_LOCATION" -a -w "$STORAGE_LOCATION" ]; then 46 | SELINUX_FLAG=$(sestatus 2>/dev/null | fgrep -q enabled && echo :z) 47 | docker_opt="$docker_opt -v $STORAGE_LOCATION:/apps/var$SELINUX_FLAG" 48 | chap_opt="--create $STORAGE_USER:/apps/var" 49 | echo Using attached storage at $STORAGE_LOCATION 50 | fi 51 | 52 | # Determine if we need to use 'sudo' 53 | DOCKER_CMD=$(docker version >/dev/null 2>&1 && echo docker || echo 'sudo docker') 54 | 55 | $DOCKER_CMD run $docker_opt $IMAGE $chap_opt $* $INTERACTIVE_SHELL 56 | -------------------------------------------------------------------------------- /baseimage/setup/apps/etc/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # A quick script to initialize the system. This is not equivalent 3 | # to the classic /etc/init.d type initailization, but more of a preparation 4 | # phase so that services have what they need to run. 5 | 6 | # We publish two variables for use in startup scripts: 7 | # 8 | # CONTAINER_INIT=1 if we are initializing the container for the first time 9 | # VAR_INIT=1 if we are initializing the $VAR_DIR for the first time 10 | # 11 | # Both may be relevant, since it's possible that the $VAR_DIR may be on a mount point 12 | # so it can be reused when starting up containers which refer to it. 13 | 14 | function dolog() { logger -t startup.sh -p info $*; } 15 | function critlog() { logger -t startup.sh -p crit $*; } 16 | 17 | var_setup_file="$VAR_DIR/run/var_setup.done" 18 | cont_setup_file="/container_setup.done" 19 | 20 | export CONTAINER_INIT=0 21 | export VAR_INIT=0 22 | 23 | # Assure anything lingering that might interfere with restart is gone 24 | rm -rf /tmp/*.pid /tmp/*.sock 25 | 26 | if [ ! -f $cont_setup_file ]; then 27 | dolog "initializing container for the first time" 28 | CONTAINER_INIT=1 29 | sudo bash -c "date >$cont_setup_file" 30 | fi 31 | 32 | if [ ! -f $var_setup_file ]; then 33 | dolog "initializing $VAR_DIR for the first time" 34 | VAR_INIT=1 35 | mkdir -p $VAR_DIR >&/dev/null 36 | if [ ! -w $VAR_DIR ]; then 37 | critlog "$VAR_DIR is not writable by user '$USER' -- cannot complete set-up" 38 | exit 1 39 | fi 40 | mkdir -p $VAR_DIR/run $VAR_DIR/log 41 | chmod 777 $VAR_DIR/run $VAR_DIR/log 42 | date >$var_setup_file 43 | fi 44 | 45 | if [ -d $APPS_DIR/startup.d ]; then 46 | for sf in $( find $APPS_DIR/startup.d -type f -executable \! -name '*~' | sort ); do 47 | dolog "running $sf..." 48 | $sf 49 | ec=$? 50 | if [ "$ec" != "0" ]; then 51 | critlog "Startup script ${sf##*/} failed with exit code '$ec'" 52 | exit $ec 53 | fi 54 | done 55 | fi 56 | 57 | if [ "$SECURE_ROOT" == "1" -a $CONTAINER_INIT == 1 ]; then 58 | dolog locking down root account 59 | sudo passwd -l root 60 | sudo sed '/NOPASSWD/ d' -i /etc/sudoers 61 | fi 62 | -------------------------------------------------------------------------------- /lemp/setup/apps/etc/nginx.conf.tpl: -------------------------------------------------------------------------------- 1 | # This file is processed by envcp. See apps/etc/start_nginx.sh 2 | 3 | # Interestingly, Nginx will attempt to write to /var/log/nginx/error.log no matter WHAT you do, so 4 | # check there if you are having startup problems, but the following should at least assure 5 | # that things go to syslog whenever Nginx deems fit. 6 | error_log syslog:server=unix:/dev/log; 7 | 8 | worker_processes 4; 9 | working_directory %(APPS_DIR); 10 | 11 | pid %(NGINX_PID_FILE); 12 | 13 | events { 14 | worker_connections 768; 15 | # multi_accept on; 16 | } 17 | 18 | http { 19 | 20 | ## 21 | # Basic Settings 22 | ## 23 | 24 | sendfile on; 25 | tcp_nopush on; 26 | tcp_nodelay on; 27 | keepalive_timeout 65; 28 | types_hash_max_size 2048; 29 | # server_tokens off; 30 | 31 | # server_names_hash_bucket_size 64; 32 | # server_name_in_redirect off; 33 | 34 | # Set an array of temp and cache file options that will otherwise default to 35 | # restricted locations accessible only to root. 36 | client_body_temp_path /tmp/client_body; 37 | fastcgi_temp_path /tmp/fastcgi_temp; 38 | proxy_temp_path /tmp/proxy_temp; 39 | scgi_temp_path /tmp/scgi_temp; 40 | uwsgi_temp_path /tmp/uwsgi_temp; 41 | 42 | include /etc/nginx/mime.types; 43 | default_type application/octet-stream; 44 | 45 | ## 46 | # Logging Settings 47 | ## 48 | 49 | access_log %(NGINX_LOG_DIR)/access.log; 50 | 51 | ## 52 | # Gzip Settings 53 | ## 54 | 55 | gzip on; 56 | gzip_disable "msie6"; 57 | 58 | # gzip_vary on; 59 | # gzip_proxied any; 60 | # gzip_comp_level 6; 61 | # gzip_buffers 16 8k; 62 | # gzip_http_version 1.1; 63 | # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 64 | 65 | ## 66 | # nginx-naxsi config 67 | ## 68 | # Uncomment it if you installed nginx-naxsi 69 | ## 70 | 71 | #include /etc/nginx/naxsi_core.rules; 72 | 73 | ## 74 | # nginx-passenger config 75 | ## 76 | # Uncomment it if you installed nginx-passenger 77 | ## 78 | 79 | #passenger_root /usr; 80 | #passenger_ruby /usr/bin/ruby; 81 | 82 | ## 83 | # Virtual Host Configs 84 | ## 85 | 86 | include %(VAR_DIR)/sites.d/*.conf; 87 | } 88 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/etc/nginx.conf.tpl: -------------------------------------------------------------------------------- 1 | # This file is processed by envcp. See apps/etc/start_nginx.sh 2 | 3 | # Interestingly, Nginx will attempt to write to /var/log/nginx/error.log no matter WHAT you do, so 4 | # check there if you are having startup problems, but the following should at least assure 5 | # that things go to syslog whenever Nginx deems fit. 6 | error_log syslog:server=unix:/dev/log; 7 | 8 | worker_processes 4; 9 | working_directory %(APPS_DIR); 10 | 11 | pid %(NGINX_PID_FILE); 12 | 13 | events { 14 | worker_connections 768; 15 | # multi_accept on; 16 | } 17 | 18 | http { 19 | 20 | ## 21 | # Basic Settings 22 | ## 23 | 24 | sendfile on; 25 | tcp_nopush on; 26 | tcp_nodelay on; 27 | keepalive_timeout 65; 28 | types_hash_max_size 2048; 29 | # server_tokens off; 30 | 31 | # server_names_hash_bucket_size 64; 32 | # server_name_in_redirect off; 33 | 34 | # Set an array of temp and cache file options that will otherwise default to 35 | # restricted locations accessible only to root. 36 | client_body_temp_path /tmp/client_body; 37 | fastcgi_temp_path /tmp/fastcgi_temp; 38 | proxy_temp_path /tmp/proxy_temp; 39 | scgi_temp_path /tmp/scgi_temp; 40 | uwsgi_temp_path /tmp/uwsgi_temp; 41 | 42 | include /etc/nginx/mime.types; 43 | default_type application/octet-stream; 44 | 45 | ## 46 | # Logging Settings 47 | ## 48 | 49 | access_log %(NGINX_LOG_DIR)/access.log; 50 | 51 | ## 52 | # Gzip Settings 53 | ## 54 | 55 | gzip on; 56 | gzip_disable "msie6"; 57 | 58 | # gzip_vary on; 59 | # gzip_proxied any; 60 | # gzip_comp_level 6; 61 | # gzip_buffers 16 8k; 62 | # gzip_http_version 1.1; 63 | # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 64 | 65 | ## 66 | # nginx-naxsi config 67 | ## 68 | # Uncomment it if you installed nginx-naxsi 69 | ## 70 | 71 | #include /etc/nginx/naxsi_core.rules; 72 | 73 | ## 74 | # nginx-passenger config 75 | ## 76 | # Uncomment it if you installed nginx-passenger 77 | ## 78 | 79 | #passenger_root /usr; 80 | #passenger_ruby /usr/bin/ruby; 81 | 82 | ## 83 | # Virtual Host Configs 84 | ## 85 | 86 | include %(VAR_DIR)/sites.d/*.conf; 87 | } 88 | -------------------------------------------------------------------------------- /alpine-nginx-django/setup/apps/chaperone.d/130-nginx.conf: -------------------------------------------------------------------------------- 1 | # 130-nginx2.conf 2 | # 3 | # Start up nginx and friends. 4 | # In the case where no USER variable is specified, we run as the www-data user. 5 | 6 | settings: { 7 | env_set: { 8 | NGINX_LOG_DIR: "$(VAR_DIR)/log/nginx", 9 | HTTPD_SERVER_NAME: nginx, 10 | } 11 | } 12 | 13 | # uwsgi is our chosen gateway. Though it's a bit of a pain to configure, it performs best, 14 | # and allows the uwsgi.d directory to be populated with site definitions (if needed) 15 | 16 | uwsgi.service: { 17 | type: simple, 18 | process_timeout: 15, 19 | command: "/usr/sbin/uwsgi --emperor $(APPS_DIR)/www/uwsgi.d --pidfile $(UWSGI_PID_FILE)", 20 | stdout: inherit, 21 | kill_signal: SIGQUIT, 22 | pidfile: "$(UWSGI_PID_FILE)", 23 | restart: true, 24 | uid: "$(USER:-www-data)", 25 | env_set: { 26 | UWSGI_PID_FILE: "/tmp/uwsgi.pid", 27 | }, 28 | before: nginx.service, 29 | } 30 | 31 | nginx.service: { 32 | type: forking, 33 | process_timeout: 15, 34 | command: "$(APPS_DIR)/etc/start_nginx.sh", 35 | pidfile: "$(NGINX_PID_FILE)", 36 | kill_signal: SIGQUIT, # graceful shutdown 37 | restart: true, 38 | optional: true, 39 | enabled: true, 40 | uid: "$(USER:-www-data)", 41 | env_set: { 42 | NGINX_SITES_DIR: "$(APPS_DIR)/www", 43 | NGINX_LOG_DIR: "$(VAR_DIR)/log/nginx", 44 | NGINX_PID_FILE: "/tmp/nginx.pid" 45 | }, 46 | # If Nginx does not require a database, you can leave this out. 47 | after: database, 48 | } 49 | 50 | # Use daily logging (the %d) so that log rotation isn't so important. Logs 51 | # will be created automatically for each day where they are requied. 52 | # See 300-logrotate.conf if you want to enable log rotation as a periodic 53 | # job. Note that chaperone watches for logs which are rotated and will 54 | # automatically open a new file if the old one is rotated. 55 | # 56 | # Write logs either as the USER= user, or as www-data. 57 | 58 | nginx.logging: { 59 | enabled: true, 60 | selector: 'local7.*;*.!err', 61 | file: '$(NGINX_LOG_DIR)/nginx-%d.log', 62 | uid: "$(USER:-www-data)", 63 | } 64 | 65 | nginx.logging: { 66 | enabled: true, 67 | selector: 'local7.err', 68 | stderr: true, 69 | file: '$(NGINX_LOG_DIR)/error-%d.log', 70 | uid: "$(USER:-www-data)", 71 | } 72 | -------------------------------------------------------------------------------- /nginx-django/setup/apps/chaperone.d/130-nginx.conf: -------------------------------------------------------------------------------- 1 | # 130-nginx2.conf 2 | # 3 | # Start up nginx and friends. 4 | # In the case where no USER variable is specified, we run as the www-data user. 5 | 6 | settings: { 7 | env_set: { 8 | NGINX_LOG_DIR: "$(VAR_DIR)/log/nginx", 9 | HTTPD_SERVER_NAME: nginx, 10 | } 11 | } 12 | 13 | # uwsgi is our chosen gateway. Though it's a bit of a pain to configure, it performs best, 14 | # and allows the uwsgi.d directory to be populated with site definitions (if needed) 15 | 16 | uwsgi.service: { 17 | type: simple, 18 | process_timeout: 15, 19 | command: "/usr/local/bin/uwsgi --emperor $(APPS_DIR)/www/uwsgi.d --pidfile $(UWSGI_PID_FILE)", 20 | stdout: inherit, 21 | kill_signal: SIGQUIT, 22 | pidfile: "$(UWSGI_PID_FILE)", 23 | restart: true, 24 | uid: "$(USER:-www-data)", 25 | env_set: { 26 | UWSGI_PID_FILE: "/tmp/uwsgi.pid", 27 | }, 28 | before: nginx.service, 29 | } 30 | 31 | nginx.service: { 32 | type: forking, 33 | process_timeout: 15, 34 | command: "$(APPS_DIR)/etc/start_nginx.sh", 35 | pidfile: "$(NGINX_PID_FILE)", 36 | kill_signal: SIGQUIT, # graceful shutdown 37 | restart: true, 38 | optional: true, 39 | enabled: true, 40 | uid: "$(USER:-www-data)", 41 | env_set: { 42 | NGINX_SITES_DIR: "$(APPS_DIR)/www", 43 | NGINX_LOG_DIR: "$(VAR_DIR)/log/nginx", 44 | NGINX_PID_FILE: "/tmp/nginx.pid" 45 | }, 46 | # If Nginx does not require a database, you can leave this out. 47 | after: database, 48 | } 49 | 50 | # Use daily logging (the %d) so that log rotation isn't so important. Logs 51 | # will be created automatically for each day where they are requied. 52 | # See 300-logrotate.conf if you want to enable log rotation as a periodic 53 | # job. Note that chaperone watches for logs which are rotated and will 54 | # automatically open a new file if the old one is rotated. 55 | # 56 | # Write logs either as the USER= user, or as www-data. 57 | 58 | nginx.logging: { 59 | enabled: true, 60 | selector: 'local7.*;*.!err', 61 | file: '$(NGINX_LOG_DIR)/nginx-%d.log', 62 | uid: "$(USER:-www-data)", 63 | } 64 | 65 | nginx.logging: { 66 | enabled: true, 67 | selector: 'local7.err', 68 | stderr: true, 69 | file: '$(NGINX_LOG_DIR)/error-%d.log', 70 | uid: "$(USER:-www-data)", 71 | } 72 | -------------------------------------------------------------------------------- /alpine-nginx-php/setup/apps/chaperone.d/130-nginx.conf: -------------------------------------------------------------------------------- 1 | # 130-nginx2.conf 2 | # 3 | # Start up nginx. This is a "simple" service, so chaperone will monitor Nginx and restart 4 | # it if necessary. 5 | # 6 | # In the case where no USER variable is specified, we run as the www-data user. 7 | 8 | settings: { 9 | env_set: { 10 | PHPRC: "$(APPS_DIR)/etc/php-cli.ini", 11 | NGINX_LOG_DIR: "$(VAR_DIR)/log/nginx", 12 | PHPFFM_SOCKET: "/tmp/php-fpm.sock", 13 | HTTPD_SERVER_NAME: nginx, 14 | } 15 | } 16 | 17 | phpfpm.service: { 18 | type: forking, 19 | process_timeout: 15, 20 | command: "/usr/bin/php-fpm --daemonize --fpm-config $(APPS_DIR)/etc/php-fpm.conf", 21 | pidfile: "$(PHPFPM_PID_FILE)", 22 | restart: true, 23 | uid: "$(USER:-www-data)", 24 | env_set: { 25 | PHPFPM_PID_FILE: "/tmp/php-fpm.pid", 26 | PHPFPM_LOG_DIR: "$(VAR_DIR)/log/nginx", 27 | }, 28 | env_unset: [ "PHPRC" ], 29 | before: nginx.service, 30 | } 31 | 32 | nginx.service: { 33 | type: forking, 34 | process_timeout: 15, 35 | command: "$(APPS_DIR)/etc/start_nginx.sh", 36 | pidfile: "$(NGINX_PID_FILE)", 37 | kill_signal: SIGQUIT, # graceful shutdown 38 | restart: true, 39 | optional: true, 40 | enabled: true, 41 | uid: "$(USER:-www-data)", 42 | env_set: { 43 | NGINX_SITES_DIR: "$(APPS_DIR)/www", 44 | NGINX_LOG_DIR: "$(VAR_DIR)/log/nginx", 45 | NGINX_PID_FILE: "/tmp/nginx.pid" 46 | }, 47 | # If Nginx does not require a database, you can leave this out. 48 | after: database, 49 | } 50 | 51 | # Use daily logging (the %d) so that log rotation isn't so important. Logs 52 | # will be created automatically for each day where they are requied. 53 | # See 300-logrotate.conf if you want to enable log rotation as a periodic 54 | # job. Note that chaperone watches for logs which are rotated and will 55 | # automatically open a new file if the old one is rotated. 56 | # 57 | # Write logs either as the USER= user, or as www-data. 58 | 59 | nginx.logging: { 60 | enabled: true, 61 | selector: 'local7.*;*.!err', 62 | file: '$(NGINX_LOG_DIR)/nginx-%d.log', 63 | uid: "$(USER:-www-data)", 64 | } 65 | 66 | nginx.logging: { 67 | enabled: true, 68 | selector: 'local7.err', 69 | stderr: true, 70 | file: '$(NGINX_LOG_DIR)/error-%d.log', 71 | uid: "$(USER:-www-data)", 72 | } 73 | --------------------------------------------------------------------------------