Skip to content

Commit

Permalink
Merge branch 'release/0.50.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mblaschke committed May 23, 2016
2 parents 7056c5a + dfbe62e commit c82603e
Show file tree
Hide file tree
Showing 2,512 changed files with 31,173 additions and 7,680 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/test/Dockerfile
/test/vendor/
/test/.bundle/
/test/*.test
/test/docker.test.*.tar
/BLACKLIST
*.log
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
All notable changes to this project will be documented in this file.
This project adheres to [WebDevOps.io Dockerfile](https://github.com/webdevops/Dockerfile).

## [1.0.0] - upcoming

## [0.50.0] - 2016-05-23
### Changed
- Improve image sizes (backported to 0.23.0 due to build issues)
- Improved provisioning system with new python wrapper
- Modularized apache and nginx configuration
- Dockerfile are now generated via jinja2 files
- webdevops/storage is now using busybox
- Latest tag is now ubuntu 16.04
- Set clear_env to no for php-fpm (if possible)
### Added
- Added ubuntu 16.04 images (eg. php, hhvm)
- Added webdevops/php-dev webdevops/php-apache-dev webdevops/php-nginx-dev (xdebug and disabled caching for webserver)
- Added webdevops/varnish
- Added mod_expire for webdevops/apache

## [0.23.0] - 2016-04-03
### Changed
- Enabled alpine-3-php7 images
Expand Down
2 changes: 1 addition & 1 deletion DOCKER_TAG_LATEST
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ubuntu-14.04
ubuntu-16.04
14 changes: 0 additions & 14 deletions FIXME.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,9 @@ Mostly upstream issues (eg. missing or broken packages)
## All PHP 7
- Missing pear

## Ubuntu 16.04 (PHP 5)
- Missing xdebug
- Missing redis
- Missing pear

## Debian 7 (PHP 5)
- Missing redis

## Debian 9 (PHP 5)
- Missing redis

## Ubuntu 16.04 (PHP 7)
- Missing memcached

## Debian 9 (PHP 7)
- Missing memcached

## Alpine 3 (PHP5)
- Missing mhash

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 WebDevOps
Copyright (c) 2015-2016 WebDevOps

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
25 changes: 21 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
ARGS = $(filter-out $@,$(MAKECMDGOALS))
MAKEFLAGS += --silent
.PHONY: test
.PHONY: test documentation

DOCKER_REPOSITORY=`cat DOCKER_REPOSITORY`
DOCKER_TAG_LATEST=`cat DOCKER_TAG_LATEST`

list:
sh -c "echo; $(MAKE) -p no_targets__ | awk -F':' '/^[a-zA-Z0-9][^\$$#\\t=]*:([^=]|$$)/ {split(\$$1,A,/ /);for(i in A)print A[i]}' | grep -v '__\$$' | grep -v 'Makefile'| sort"

all: bootstrap base web php hhvm service misc applications
all: provision bootstrap base web php php-dev hhvm service misc applications
build: all

bootstrap: webdevops/bootstrap webdevops/ansible
base: webdevops/base webdevops/base-app webdevops/storage
service: webdevops/ssh webdevops/vsftp webdevops/postfix

php: webdevops/php webdevops/php-apache webdevops/php-nginx
php: webdevops/php webdevops/php-apache webdevops/php-nginx
php-dev: webdevops/php-dev webdevops/php-apache-dev webdevops/php-nginx-dev
hhvm: webdevops/hhvm webdevops/hhvm-apache webdevops/hhvm-nginx

web: webdevops/apache webdevops/nginx
web: webdevops/apache webdevops/nginx webdevops/varnish

applications: webdevops/typo3 webdevops/piwik

Expand All @@ -31,6 +32,7 @@ test-hub-images:
DOCKER_PULL=1 make test

provision:
python bin/buildDockerfile.py --template=template/ --dockerfile=docker/
bash bin/provision.sh

publish: dist-update rebuild test push
Expand Down Expand Up @@ -67,6 +69,9 @@ rebuild:
push:
BUILD_MODE=push make all

documentation:
docker run -t -i --rm -p 8080:8000 -v "$$(pwd)/documentation/docs/:/opt/docs" webdevops/sphinx sphinx-autobuild --poll -H 0.0.0.0 /opt/docs html

webdevops/bootstrap:
bash bin/build.sh bootstrap "${DOCKER_REPOSITORY}/bootstrap" "${DOCKER_TAG_LATEST}"

Expand All @@ -82,6 +87,9 @@ webdevops/base-app:
webdevops/php:
bash bin/build.sh php "${DOCKER_REPOSITORY}/php" "${DOCKER_TAG_LATEST}"

webdevops/php-dev:
bash bin/build.sh php-dev "${DOCKER_REPOSITORY}/php-dev" "${DOCKER_TAG_LATEST}"

webdevops/apache:
bash bin/build.sh apache "${DOCKER_REPOSITORY}/apache" "${DOCKER_TAG_LATEST}"

Expand All @@ -91,9 +99,15 @@ webdevops/nginx:
webdevops/php-apache:
bash bin/build.sh php-apache "${DOCKER_REPOSITORY}/php-apache" "${DOCKER_TAG_LATEST}"

webdevops/php-apache-dev:
bash bin/build.sh php-apache-dev "${DOCKER_REPOSITORY}/php-apache-dev" "${DOCKER_TAG_LATEST}"

webdevops/php-nginx:
bash bin/build.sh php-nginx "${DOCKER_REPOSITORY}/php-nginx" "${DOCKER_TAG_LATEST}"

webdevops/php-nginx-dev:
bash bin/build.sh php-nginx-dev "${DOCKER_REPOSITORY}/php-nginx-dev" "${DOCKER_TAG_LATEST}"

webdevops/hhvm:
bash bin/build.sh hhvm "${DOCKER_REPOSITORY}/hhvm" "${DOCKER_TAG_LATEST}"

Expand Down Expand Up @@ -129,3 +143,6 @@ webdevops/samson-deployment:

webdevops/sphinx:
bash bin/build.sh sphinx "${DOCKER_REPOSITORY}/sphinx" "${DOCKER_TAG_LATEST}"

webdevops/varnish:
bash bin/build.sh varnish "${DOCKER_REPOSITORY}/varnish" "${DOCKER_TAG_LATEST}"
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Dockerfiles for various prebuilt docker containers

[![Docker layout](https://static.webdevops.io/docker-layout.small.png)](https://static.webdevops.io/docker-layout.png)
[![Docker layout](documentation/webdevops.gv.png)](documentation/webdevops.gv.png)

Dockerfile | Description | Depends on |
--------------------------------------------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
Expand All @@ -16,12 +16,13 @@ Dockerfile | Description
[`hhvm-apache`](docker/hhvm-apache/README.md) | HHVM (cli and fcgi) with Apache service containers | [`webdevops/hhvm`](https://hub.docker.com/r/webdevops/hhvm/) |
[`hhvm-nginx`](docker/hhvm-nginx/README.md) | HHVM (cli and fcgi) with Nginx service containers | [`webdevops/hhvm`](https://hub.docker.com/r/webdevops/hhvm/) |
[`vsftp`](docker/vsftp/README.md) | VSFTP (ftp service) service container | [`webdevops/base:latest`](https://hub.docker.com/r/webdevops/base/) |
[`storage`](docker/storage/README.md) | Storage (noop) container | [`webdevops/base:latest`](https://hub.docker.com/r/webdevops/base/) |
[`storage`](docker/storage/latest/README.md) | Storage (noop) container | [`webdevops/base:latest`](https://hub.docker.com/r/webdevops/base/) |
[`ssh`](docker/ssh/README.md) | SSH service container | [`webdevops/base:latest`](https://hub.docker.com/r/webdevops/base/) |
[`postfix`](docker/postfix/README.md) | Postfix service container | [`webdevops/base:latest`](https://hub.docker.com/r/webdevops/base/) |
[`mail-sandbox`](docker/mail-sandbox/README.md) | Mail catcher service container (catches all mails via SMTP and are accessable via IMAP) | [`webdevops/postfix:latest`](https://hub.docker.com/r/webdevops/postfix/) |
[`samson-deployment`](docker/samson-deployment/README.md) | [Samson](https://github.com/webdevops/samson-deployment) based deployment service | [`zendesk/samson`](https://hub.docker.com/r/zendesk/samson/) |
[`sphinx`](docker/sphinx/README.md) | Sphinx container | [`webdevops/bootstrap:alpine-3`](https://hub.docker.com/r/webdevops/bootstrap/) |
[`sphinx`](docker/sphinx/latest/README.md) | Sphinx container | [`webdevops/bootstrap:alpine-3`](https://hub.docker.com/r/webdevops/bootstrap/) |
[`varnish`](docker/varnish/latest/README.md) | Varnish container | [`webdevops/base:alpine-3`](https://hub.docker.com/r/webdevops/bootstrap/) |

# Building

Expand Down
2 changes: 1 addition & 1 deletion baselayout/usr/local/bin/apt-install
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export DEBIAN_FRONTEND=noninteractive
apt-get update

# Install packages
apt-get install -y -f $*
apt-get install -y -f --no-install-recommends $*

# Clear files (reduce snapshot size)
rm -rf /var/lib/apt/lists/*
Expand Down
14 changes: 10 additions & 4 deletions baselayout/usr/local/bin/generate-locales
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,23 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
## Debian
#######################################

if [[ -f /etc/os-release ]] && [[ -n "$(awk -F= '/^NAME/{print $2}' /etc/os-release|grep -i Debian)" ]]; then
if [[ "$(lsb_release -i -s)" == "Debian" ]]; then
/usr/local/bin/apt-install locales-all
fi

#######################################
## Ubuntu
#######################################

if [[ -f /etc/os-release ]] && [[ -n "$(awk -F= '/^NAME/{print $2}' /etc/os-release|grep -i Ubuntu)" ]]; then
ln -s /usr/share/i18n/SUPPORTED /var/lib/locales/supported.d/all
locale-gen
if [[ "$(lsb_release -i -s)" == "Ubuntu" ]]; then
if [[ "$(lsb_release -r -s | cut -f 1 -d .)" -ge "16" ]]; then
# Ubuntu 16.04 or later
/usr/local/bin/apt-install locales-all
else
# Ubuntu pre 16.04 versions
ln -s /usr/share/i18n/SUPPORTED /var/lib/locales/supported.d/all
locale-gen
fi
fi

#######################################
Expand Down
8 changes: 0 additions & 8 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,6 @@ echo ""

sleep 0.5


#############################
# Provision
#############################

bash "${BASE_DIR}/bin/provision.sh" "$TARGET"
echo ""

#############################
# Main
#############################
Expand Down
67 changes: 67 additions & 0 deletions bin/buildDockerfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env/python

from jinja2 import Environment, FileSystemLoader
from datetime import datetime
import os
import argparse

PATH = os.path.dirname(os.path.abspath(__file__))

templateHeader = '{% extends "Dockerfile/layout.jinja2" %}\n{% block content %}'
templateFooter = '{% endblock %}'

def get_current_date():
import datetime
return datetime.date.today().strftime("%d.%m.%Y")

def processDockerfile(inputFile, template):
outputFile = os.path.splitext(inputFile)
outputFile = os.path.join(os.path.dirname(outputFile[0]),os.path.basename(outputFile[0]))

dockerImage = os.path.basename(os.path.dirname(os.path.dirname(outputFile)))
dockerTag = os.path.basename(os.path.dirname(outputFile))

context = {
'Dockerfile': {
'image': dockerImage,
'tag': dockerTag
}
}

print "* Processing Dockerfile for " + dockerImage + ":" + dockerTag

with open(inputFile, 'r') as fileInput:
templateContent = fileInput.read()

templateContent = templateHeader + templateContent + templateFooter

renderedContent = template.from_string(templateContent).render(context)
renderedContent = renderedContent.lstrip()

with open(outputFile, 'w') as fileOutput:
fileOutput.write(renderedContent)



def main(args):
templatePath = os.path.abspath(args.template)
dockerfilePath = os.path.abspath(args.dockerfile)

template = Environment(
autoescape=False,
loader=FileSystemLoader([templatePath]),
trim_blocks=False
)

for root, dirs, files in os.walk(dockerfilePath):
for file in files:
if file.endswith("Dockerfile.jinja2"):
processDockerfile(os.path.join(root, file), template)


if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-t','--template' ,help='',type=str)
parser.add_argument('-d','--dockerfile' ,help='',type=str)
args = parser.parse_args()
main(args)
Loading

0 comments on commit c82603e

Please sign in to comment.