Skip to content

Commit 83cedb1

Browse files
committed
First commit to master branch workspace version 5.6
0 parents  commit 83cedb1

26 files changed

+1451
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
.env

.travis.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
language: bash
2+
3+
dist: trusty
4+
5+
sudo: required
6+
7+
services:
8+
- docker
9+
10+
env:
11+
global:
12+
- COMMIT=${TRAVIS_COMMIT::8}
13+
- REPO=dockerframework/workspace-phpfpm:5.6
14+
- CGO_ENABLED=0
15+
- GOOS=linux
16+
- GOARCH=amd64
17+
18+
before_install:
19+
- sudo chmod +x ./tests/docker_tests.sh
20+
- sudo chmod +x ./tests/docker_run.sh
21+
- sudo apt-get update
22+
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
23+
- echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -s devicemapper"' | sudo tee /etc/default/docker > /dev/null
24+
- sudo service docker restart
25+
- sleep 3
26+
27+
script:
28+
- ./tests/docker_tests.sh
29+
- ./tests/docker_run.sh

Dockerfile

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
FROM dockerframework/phpfpm:5.6
2+
3+
# ================================================================================================
4+
# Inspiration: Docker Framework (https://github.com/zeroc0d3/docker-framework)
5+
# Dwi Fahni Denni <zeroc0d3.0912@gmail.com>
6+
# ================================================================================================
7+
# Core Contributors:
8+
# - Mahmoud Zalt @mahmoudz
9+
# - Bo-Yi Wu @appleboy
10+
# - Philippe Trépanier @philtrep
11+
# - Mike Erickson @mikeerickson
12+
# - Dwi Fahni Denni @zeroc0d3
13+
# - Thor Erik @thorerik
14+
# - Winfried van Loon @winfried-van-loon
15+
# - TJ Miller @sixlive
16+
# - Yu-Lung Shao (Allen) @bestlong
17+
# - Milan Urukalo @urukalo
18+
# - Vince Chu @vwchu
19+
# - Huadong Zuo @zuohuadong
20+
# ================================================================================================
21+
22+
MAINTAINER "Laradock Team <mahmoud@zalt.me>"
23+
24+
ENV PHP_VERSION=5.6.35 \
25+
ALPINE_VERSION=3.4 \
26+
XDEBUG_VERSION=2.5.5
27+
28+
COPY docker-php-source /usr/local/bin/
29+
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
30+
RUN docker-php-ext-enable opcache
31+
32+
ENV NODE_VERSION=6.14.2
33+
RUN addgroup -g 1000 node \
34+
&& adduser -u 1000 -G node -s /bin/sh -D node \
35+
&& apk add --no-cache \
36+
libstdc++ \
37+
&& apk add --no-cache --virtual .build-deps \
38+
binutils-gold \
39+
curl \
40+
g++ \
41+
gcc \
42+
gnupg \
43+
libgcc \
44+
linux-headers \
45+
make \
46+
python \
47+
# gpg keys listed at https://github.com/nodejs/node#release-team
48+
&& for key in \
49+
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
50+
FD3A5288F042B6850C66B31F09FE44734EB7990E \
51+
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
52+
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
53+
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
54+
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
55+
56730D5401028683275BD23C23EFEFE93C4CFFFE \
56+
77984A986EBC2AA786BC0F66B01FBB92821C587A \
57+
; do \
58+
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
59+
gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
60+
gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
61+
done \
62+
&& curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
63+
&& curl -SLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
64+
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
65+
&& grep " node-v$NODE_VERSION.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
66+
&& tar -xf "node-v$NODE_VERSION.tar.xz" \
67+
&& cd "node-v$NODE_VERSION" \
68+
&& ./configure \
69+
&& make -j$(getconf _NPROCESSORS_ONLN) \
70+
&& make install \
71+
&& apk del .build-deps \
72+
&& cd .. \
73+
&& rm -Rf "node-v$NODE_VERSION" \
74+
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt
75+
76+
ENV YARN_VERSION=1.6.0
77+
RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar \
78+
&& for key in \
79+
6A010C5166006599AA17F08146C2130DFD2497F5 \
80+
; do \
81+
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
82+
gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
83+
gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
84+
done \
85+
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
86+
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
87+
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
88+
&& mkdir -p /opt \
89+
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
90+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
91+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
92+
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
93+
&& apk del .build-deps-yarn
94+
95+
ENTRYPOINT ["docker-php-entrypoint"]
96+
WORKDIR /var/www/html
97+
98+
EXPOSE 9200 9000 9090 80
99+
CMD ["php-fpm"]
100+
101+
VOLUME ["/var/www/html"]

Dockerfile.build

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM alpine:3.4
8+
9+
# dependencies required for running "phpize"
10+
# these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed)
11+
ENV PHPIZE_DEPS \
12+
autoconf \
13+
dpkg-dev dpkg \
14+
file \
15+
g++ \
16+
gcc \
17+
libc-dev \
18+
make \
19+
pkgconf \
20+
re2c
21+
22+
# persistent / runtime deps
23+
RUN apk add --no-cache --virtual .persistent-deps \
24+
ca-certificates \
25+
curl \
26+
tar \
27+
xz \
28+
# https://github.com/docker-library/php/issues/494
29+
openssl
30+
31+
# ensure www-data user exists
32+
RUN set -x \
33+
&& addgroup -g 82 -S www-data \
34+
&& adduser -u 82 -D -S -G www-data www-data
35+
# 82 is the standard uid/gid for "www-data" in Alpine
36+
# http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2
37+
# http://git.alpinelinux.org/cgit/aports/tree/main/lighttpd/lighttpd.pre-install?h=v3.3.2
38+
# http://git.alpinelinux.org/cgit/aports/tree/main/nginx-initscripts/nginx-initscripts.pre-install?h=v3.3.2
39+
40+
ENV PHP_INI_DIR /usr/local/etc/php
41+
RUN mkdir -p $PHP_INI_DIR/conf.d
42+
43+
##<autogenerated>##
44+
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data
45+
##</autogenerated>##
46+
47+
# Apply stack smash protection to functions using local buffers and alloca()
48+
# Make PHP's main executable position-independent (improves ASLR security mechanism, and has no performance impact on x86_64)
49+
# Enable optimization (-O2)
50+
# Enable linker optimization (this sorts the hash buckets to improve cache locality, and is non-default)
51+
# Adds GNU HASH segments to generated executables (this is used if present, and is much faster than sysv hash; in this configuration, sysv hash is also generated)
52+
# https://github.com/docker-library/php/issues/272
53+
ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2"
54+
ENV PHP_CPPFLAGS="$PHP_CFLAGS"
55+
ENV PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie"
56+
57+
ENV GPG_KEYS 0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3
58+
59+
ENV PHP_VERSION 5.6.36
60+
ENV PHP_URL="https://secure.php.net/get/php-5.6.36.tar.xz/from/this/mirror" PHP_ASC_URL="https://secure.php.net/get/php-5.6.36.tar.xz.asc/from/this/mirror"
61+
ENV PHP_SHA256="18f536bf548e909b4e980379d0c4e56d024b2b1eb1c9768fd169360491f1d6dd" PHP_MD5=""
62+
63+
RUN set -xe; \
64+
\
65+
apk add --no-cache --virtual .fetch-deps \
66+
gnupg \
67+
; \
68+
\
69+
mkdir -p /usr/src; \
70+
cd /usr/src; \
71+
\
72+
wget -O php.tar.xz "$PHP_URL"; \
73+
\
74+
if [ -n "$PHP_SHA256" ]; then \
75+
echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; \
76+
fi; \
77+
if [ -n "$PHP_MD5" ]; then \
78+
echo "$PHP_MD5 *php.tar.xz" | md5sum -c -; \
79+
fi; \
80+
\
81+
if [ -n "$PHP_ASC_URL" ]; then \
82+
wget -O php.tar.xz.asc "$PHP_ASC_URL"; \
83+
export GNUPGHOME="$(mktemp -d)"; \
84+
for key in $GPG_KEYS; do \
85+
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \
86+
done; \
87+
gpg --batch --verify php.tar.xz.asc php.tar.xz; \
88+
rm -rf "$GNUPGHOME"; \
89+
fi; \
90+
\
91+
apk del .fetch-deps
92+
93+
COPY docker-php-source /usr/local/bin/
94+
95+
RUN set -xe \
96+
&& apk add --no-cache --virtual .build-deps \
97+
$PHPIZE_DEPS \
98+
coreutils \
99+
curl-dev \
100+
libedit-dev \
101+
openssl-dev \
102+
libxml2-dev \
103+
sqlite-dev \
104+
\
105+
&& export CFLAGS="$PHP_CFLAGS" \
106+
CPPFLAGS="$PHP_CPPFLAGS" \
107+
LDFLAGS="$PHP_LDFLAGS" \
108+
&& docker-php-source extract \
109+
&& cd /usr/src/php \
110+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
111+
&& ./configure \
112+
--build="$gnuArch" \
113+
--with-config-file-path="$PHP_INI_DIR" \
114+
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
115+
\
116+
# make sure invalid --configure-flags are fatal errors intead of just warnings
117+
--enable-option-checking=fatal \
118+
\
119+
--disable-cgi \
120+
\
121+
# https://github.com/docker-library/php/issues/439
122+
--with-mhash \
123+
\
124+
# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
125+
--enable-ftp \
126+
# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
127+
--enable-mbstring \
128+
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
129+
--enable-mysqlnd \
130+
\
131+
--with-curl \
132+
--with-libedit \
133+
--with-openssl \
134+
--with-zlib \
135+
\
136+
# bundled pcre does not support JIT on s390x
137+
# https://manpages.debian.org/stretch/libpcre3-dev/pcrejit.3.en.html#AVAILABILITY_OF_JIT_SUPPORT
138+
$(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') \
139+
\
140+
$PHP_EXTRA_CONFIGURE_ARGS \
141+
&& make -j "$(nproc)" \
142+
&& make install \
143+
&& { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \
144+
&& make clean \
145+
&& cd / \
146+
&& docker-php-source delete \
147+
\
148+
&& runDeps="$( \
149+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
150+
| tr ',' '\n' \
151+
| sort -u \
152+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
153+
)" \
154+
&& apk add --no-cache --virtual .php-rundeps $runDeps \
155+
\
156+
&& apk del .build-deps \
157+
\
158+
# https://github.com/docker-library/php/issues/443
159+
&& pecl update-channels \
160+
&& rm -rf /tmp/pear ~/.pearrc
161+
162+
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/
163+
164+
ENTRYPOINT ["docker-php-entrypoint"]
165+
##<autogenerated>##
166+
WORKDIR /var/www/html
167+
168+
RUN set -ex \
169+
&& cd /usr/local/etc \
170+
&& if [ -d php-fpm.d ]; then \
171+
# for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf"
172+
sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \
173+
cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \
174+
else \
175+
# PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency
176+
mkdir php-fpm.d; \
177+
cp php-fpm.conf.default php-fpm.d/www.conf; \
178+
{ \
179+
echo '[global]'; \
180+
echo 'include=etc/php-fpm.d/*.conf'; \
181+
} | tee php-fpm.conf; \
182+
fi \
183+
&& { \
184+
echo '[global]'; \
185+
echo 'error_log = /proc/self/fd/2'; \
186+
echo; \
187+
echo '[www]'; \
188+
echo '; if we send this to /proc/self/fd/1, it never appears'; \
189+
echo 'access.log = /proc/self/fd/2'; \
190+
echo; \
191+
echo 'clear_env = no'; \
192+
echo; \
193+
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
194+
echo 'catch_workers_output = yes'; \
195+
} | tee php-fpm.d/docker.conf \
196+
&& { \
197+
echo '[global]'; \
198+
echo 'daemonize = no'; \
199+
echo; \
200+
echo '[www]'; \
201+
echo 'listen = 9000'; \
202+
} | tee php-fpm.d/zz-docker.conf
203+
204+
EXPOSE 9000
205+
CMD ["php-fpm"]
206+
##</autogenerated>##

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Docker Framework
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 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,
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 THE
21+
SOFTWARE.

Makefile.am

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
IMAGE = dockerframework/workspace-phpfpm
2+
3+
clean-local:
4+
docker rmi $(CLEAN_OPTIONS) $(IMAGE):$(TAG) || true
5+
6+
build:
7+
docker build $(BUILD_OPTIONS) -t $(IMAGE):$(TAG) .
8+
9+
pull:
10+
docker pull $(PULL_OPTIONS) $(IMAGE):$(TAG)
11+
12+
push: build
13+
docker push $(PUSH_OPTIONS) $(IMAGE):$(TAG)

0 commit comments

Comments
 (0)