Skip to content

Commit c82603e

Browse files
committed
Merge branch 'release/0.50.0'
2 parents 7056c5a + dfbe62e commit c82603e

File tree

2,512 files changed

+31173
-7680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,512 files changed

+31173
-7680
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/test/Dockerfile
33
/test/vendor/
44
/test/.bundle/
5+
/test/*.test
56
/test/docker.test.*.tar
67
/BLACKLIST
78
*.log

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [WebDevOps.io Dockerfile](https://github.com/webdevops/Dockerfile).
44

5+
## [1.0.0] - upcoming
6+
7+
## [0.50.0] - 2016-05-23
8+
### Changed
9+
- Improve image sizes (backported to 0.23.0 due to build issues)
10+
- Improved provisioning system with new python wrapper
11+
- Modularized apache and nginx configuration
12+
- Dockerfile are now generated via jinja2 files
13+
- webdevops/storage is now using busybox
14+
- Latest tag is now ubuntu 16.04
15+
- Set clear_env to no for php-fpm (if possible)
16+
### Added
17+
- Added ubuntu 16.04 images (eg. php, hhvm)
18+
- Added webdevops/php-dev webdevops/php-apache-dev webdevops/php-nginx-dev (xdebug and disabled caching for webserver)
19+
- Added webdevops/varnish
20+
- Added mod_expire for webdevops/apache
21+
522
## [0.23.0] - 2016-04-03
623
### Changed
724
- Enabled alpine-3-php7 images

DOCKER_TAG_LATEST

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ubuntu-14.04
1+
ubuntu-16.04

FIXME.md

-14
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,9 @@ Mostly upstream issues (eg. missing or broken packages)
44
## All PHP 7
55
- Missing pear
66

7-
## Ubuntu 16.04 (PHP 5)
8-
- Missing xdebug
9-
- Missing redis
10-
- Missing pear
11-
127
## Debian 7 (PHP 5)
138
- Missing redis
149

15-
## Debian 9 (PHP 5)
16-
- Missing redis
17-
18-
## Ubuntu 16.04 (PHP 7)
19-
- Missing memcached
20-
21-
## Debian 9 (PHP 7)
22-
- Missing memcached
23-
2410
## Alpine 3 (PHP5)
2511
- Missing mhash
2612

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 WebDevOps
3+
Copyright (c) 2015-2016 WebDevOps
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

+21-4
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
ARGS = $(filter-out $@,$(MAKECMDGOALS))
22
MAKEFLAGS += --silent
3-
.PHONY: test
3+
.PHONY: test documentation
44

55
DOCKER_REPOSITORY=`cat DOCKER_REPOSITORY`
66
DOCKER_TAG_LATEST=`cat DOCKER_TAG_LATEST`
77

88
list:
99
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"
1010

11-
all: bootstrap base web php hhvm service misc applications
11+
all: provision bootstrap base web php php-dev hhvm service misc applications
1212
build: all
1313

1414
bootstrap: webdevops/bootstrap webdevops/ansible
1515
base: webdevops/base webdevops/base-app webdevops/storage
1616
service: webdevops/ssh webdevops/vsftp webdevops/postfix
1717

18-
php: webdevops/php webdevops/php-apache webdevops/php-nginx
18+
php: webdevops/php webdevops/php-apache webdevops/php-nginx
19+
php-dev: webdevops/php-dev webdevops/php-apache-dev webdevops/php-nginx-dev
1920
hhvm: webdevops/hhvm webdevops/hhvm-apache webdevops/hhvm-nginx
2021

21-
web: webdevops/apache webdevops/nginx
22+
web: webdevops/apache webdevops/nginx webdevops/varnish
2223

2324
applications: webdevops/typo3 webdevops/piwik
2425

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

3334
provision:
35+
python bin/buildDockerfile.py --template=template/ --dockerfile=docker/
3436
bash bin/provision.sh
3537

3638
publish: dist-update rebuild test push
@@ -67,6 +69,9 @@ rebuild:
6769
push:
6870
BUILD_MODE=push make all
6971

72+
documentation:
73+
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
74+
7075
webdevops/bootstrap:
7176
bash bin/build.sh bootstrap "${DOCKER_REPOSITORY}/bootstrap" "${DOCKER_TAG_LATEST}"
7277

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

90+
webdevops/php-dev:
91+
bash bin/build.sh php-dev "${DOCKER_REPOSITORY}/php-dev" "${DOCKER_TAG_LATEST}"
92+
8593
webdevops/apache:
8694
bash bin/build.sh apache "${DOCKER_REPOSITORY}/apache" "${DOCKER_TAG_LATEST}"
8795

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

102+
webdevops/php-apache-dev:
103+
bash bin/build.sh php-apache-dev "${DOCKER_REPOSITORY}/php-apache-dev" "${DOCKER_TAG_LATEST}"
104+
94105
webdevops/php-nginx:
95106
bash bin/build.sh php-nginx "${DOCKER_REPOSITORY}/php-nginx" "${DOCKER_TAG_LATEST}"
96107

108+
webdevops/php-nginx-dev:
109+
bash bin/build.sh php-nginx-dev "${DOCKER_REPOSITORY}/php-nginx-dev" "${DOCKER_TAG_LATEST}"
110+
97111
webdevops/hhvm:
98112
bash bin/build.sh hhvm "${DOCKER_REPOSITORY}/hhvm" "${DOCKER_TAG_LATEST}"
99113

@@ -129,3 +143,6 @@ webdevops/samson-deployment:
129143

130144
webdevops/sphinx:
131145
bash bin/build.sh sphinx "${DOCKER_REPOSITORY}/sphinx" "${DOCKER_TAG_LATEST}"
146+
147+
webdevops/varnish:
148+
bash bin/build.sh varnish "${DOCKER_REPOSITORY}/varnish" "${DOCKER_TAG_LATEST}"

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Dockerfiles for various prebuilt docker containers
44

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

77
Dockerfile | Description | Depends on |
88
--------------------------------------------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
@@ -16,12 +16,13 @@ Dockerfile | Description
1616
[`hhvm-apache`](docker/hhvm-apache/README.md) | HHVM (cli and fcgi) with Apache service containers | [`webdevops/hhvm`](https://hub.docker.com/r/webdevops/hhvm/) |
1717
[`hhvm-nginx`](docker/hhvm-nginx/README.md) | HHVM (cli and fcgi) with Nginx service containers | [`webdevops/hhvm`](https://hub.docker.com/r/webdevops/hhvm/) |
1818
[`vsftp`](docker/vsftp/README.md) | VSFTP (ftp service) service container | [`webdevops/base:latest`](https://hub.docker.com/r/webdevops/base/) |
19-
[`storage`](docker/storage/README.md) | Storage (noop) container | [`webdevops/base:latest`](https://hub.docker.com/r/webdevops/base/) |
19+
[`storage`](docker/storage/latest/README.md) | Storage (noop) container | [`webdevops/base:latest`](https://hub.docker.com/r/webdevops/base/) |
2020
[`ssh`](docker/ssh/README.md) | SSH service container | [`webdevops/base:latest`](https://hub.docker.com/r/webdevops/base/) |
2121
[`postfix`](docker/postfix/README.md) | Postfix service container | [`webdevops/base:latest`](https://hub.docker.com/r/webdevops/base/) |
2222
[`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/) |
2323
[`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/) |
24-
[`sphinx`](docker/sphinx/README.md) | Sphinx container | [`webdevops/bootstrap:alpine-3`](https://hub.docker.com/r/webdevops/bootstrap/) |
24+
[`sphinx`](docker/sphinx/latest/README.md) | Sphinx container | [`webdevops/bootstrap:alpine-3`](https://hub.docker.com/r/webdevops/bootstrap/) |
25+
[`varnish`](docker/varnish/latest/README.md) | Varnish container | [`webdevops/base:alpine-3`](https://hub.docker.com/r/webdevops/bootstrap/) |
2526

2627
# Building
2728

baselayout/usr/local/bin/apt-install

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export DEBIAN_FRONTEND=noninteractive
1111
apt-get update
1212

1313
# Install packages
14-
apt-get install -y -f $*
14+
apt-get install -y -f --no-install-recommends $*
1515

1616
# Clear files (reduce snapshot size)
1717
rm -rf /var/lib/apt/lists/*

baselayout/usr/local/bin/generate-locales

+10-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,23 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
1010
## Debian
1111
#######################################
1212

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

1717
#######################################
1818
## Ubuntu
1919
#######################################
2020

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

2632
#######################################

bin/build.sh

-8
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,6 @@ echo ""
201201

202202
sleep 0.5
203203

204-
205-
#############################
206-
# Provision
207-
#############################
208-
209-
bash "${BASE_DIR}/bin/provision.sh" "$TARGET"
210-
echo ""
211-
212204
#############################
213205
# Main
214206
#############################

bin/buildDockerfile.py

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env/python
2+
3+
from jinja2 import Environment, FileSystemLoader
4+
from datetime import datetime
5+
import os
6+
import argparse
7+
8+
PATH = os.path.dirname(os.path.abspath(__file__))
9+
10+
templateHeader = '{% extends "Dockerfile/layout.jinja2" %}\n{% block content %}'
11+
templateFooter = '{% endblock %}'
12+
13+
def get_current_date():
14+
import datetime
15+
return datetime.date.today().strftime("%d.%m.%Y")
16+
17+
def processDockerfile(inputFile, template):
18+
outputFile = os.path.splitext(inputFile)
19+
outputFile = os.path.join(os.path.dirname(outputFile[0]),os.path.basename(outputFile[0]))
20+
21+
dockerImage = os.path.basename(os.path.dirname(os.path.dirname(outputFile)))
22+
dockerTag = os.path.basename(os.path.dirname(outputFile))
23+
24+
context = {
25+
'Dockerfile': {
26+
'image': dockerImage,
27+
'tag': dockerTag
28+
}
29+
}
30+
31+
print "* Processing Dockerfile for " + dockerImage + ":" + dockerTag
32+
33+
with open(inputFile, 'r') as fileInput:
34+
templateContent = fileInput.read()
35+
36+
templateContent = templateHeader + templateContent + templateFooter
37+
38+
renderedContent = template.from_string(templateContent).render(context)
39+
renderedContent = renderedContent.lstrip()
40+
41+
with open(outputFile, 'w') as fileOutput:
42+
fileOutput.write(renderedContent)
43+
44+
45+
46+
def main(args):
47+
templatePath = os.path.abspath(args.template)
48+
dockerfilePath = os.path.abspath(args.dockerfile)
49+
50+
template = Environment(
51+
autoescape=False,
52+
loader=FileSystemLoader([templatePath]),
53+
trim_blocks=False
54+
)
55+
56+
for root, dirs, files in os.walk(dockerfilePath):
57+
for file in files:
58+
if file.endswith("Dockerfile.jinja2"):
59+
processDockerfile(os.path.join(root, file), template)
60+
61+
62+
if __name__ == '__main__':
63+
parser = argparse.ArgumentParser()
64+
parser.add_argument('-t','--template' ,help='',type=str)
65+
parser.add_argument('-d','--dockerfile' ,help='',type=str)
66+
args = parser.parse_args()
67+
main(args)

0 commit comments

Comments
 (0)