Compare commits

...

631 Commits
0.79 ... 0.146

Author SHA1 Message Date
cytopia
28a4f2ac37 Merge pull request #256 from devilbox/release-0.146
Release 0.146
2022-12-12 06:23:39 +01:00
cytopia
204afad4e4 Update docs for install.yml 2022-12-11 14:10:04 +01:00
cytopia
a4708249d5 Update options.yml documentation 2022-12-11 13:24:56 +01:00
cytopia
d81f406871 Update Documentaion for PHP module generation 2022-12-11 13:09:57 +01:00
cytopia
3cda0b7da3 Document PHP tool generation 2022-12-11 13:09:21 +01:00
cytopia
02b3bda76f Update flavours 2022-12-11 12:48:29 +01:00
cytopia
45924e67ba Update README 2022-12-11 12:48:16 +01:00
cytopia
e8c5a4270f Fixed Python Black linting errors 2022-12-11 11:41:21 +01:00
cytopia
364c28b248 Streamline php_modules and php_tools definitions 2022-12-11 11:38:34 +01:00
cytopia
a122d6685d Only build on specific changes 2022-12-11 10:54:07 +01:00
cytopia
be2e96d4a2 Update documentation 2022-12-11 10:36:14 +01:00
cytopia
ff61a450ac Merge pull request #255 from devilbox/doc-fixes
Enhance documentation
2022-12-10 18:44:13 +01:00
cytopia
7e775622a5 Enhance documentation 2022-12-10 18:43:56 +01:00
cytopia
7cc5e25528 Merge pull request #254 from devilbox/release-0.145
Release 0.145
2022-12-10 18:01:22 +01:00
cytopia
b6265751ba Fixed file-lint findings 2022-12-09 19:16:05 +01:00
cytopia
f09e5ad64e Re-enable workflows 2022-12-09 19:15:53 +01:00
cytopia
bfbb967cb8 Re-enabled modules 2022-12-09 19:13:35 +01:00
cytopia
ceadad5512 Adjusted documentation 2022-12-09 19:12:49 +01:00
cytopia
eec7f6c0e2 Add taskfile 2022-12-09 14:25:02 +01:00
cytopia
5567bc0a8c Fix nvm path 2022-12-09 14:24:42 +01:00
cytopia
3934fdc912 Add wkhtmltopdf 2022-12-09 12:50:34 +01:00
cytopia
e34c71f377 Renable some PHP exts for testing 2022-12-09 11:21:47 +01:00
cytopia
8f7953248f Fix mutool check 2022-12-09 11:19:43 +01:00
cytopia
30c3118a22 Backport more tools 2022-12-09 11:12:08 +01:00
cytopia
c3628171f1 Fix subset of PHP exts for testing 2022-12-09 09:48:10 +01:00
cytopia
9dea48147d Temporarily disable CI tests 2022-12-09 09:47:46 +01:00
cytopia
36bc9dc099 Backport more toole 2022-12-09 09:44:40 +01:00
cytopia
820159d95a Fix markdown 2022-12-08 21:16:27 +01:00
cytopia
a7292fdff9 Backport more tools for work flavour 2022-12-08 20:52:37 +01:00
cytopia
2bb64ccff6 Fix missing shared libraries 2022-12-08 12:45:47 +01:00
cytopia
39db14d294 Fix Python linter warnings 2022-12-08 12:41:44 +01:00
cytopia
b724ceaca3 Temporarily enable only required PHP extensions for faster builds 2022-12-08 12:35:10 +01:00
cytopia
308f435a7b Backport tools 2022-12-08 12:34:36 +01:00
cytopia
5b41a9b2f7 Fix extension chmod command on empty dir 2022-12-08 11:01:13 +01:00
cytopia
725f52eda8 Fix shared libs for mongodb 2022-12-08 09:22:42 +01:00
cytopia
796b04b457 Strip debugging information to reduce file sizes 2022-12-08 08:45:50 +01:00
cytopia
92b217fc53 Fixed shellcheck linting 2022-12-08 07:35:03 +01:00
cytopia
d79d834413 Updated CHANGELOG 2022-12-08 07:34:39 +01:00
cytopia
24c58ce57e Doc: updated available PHP tools 2022-12-08 07:26:48 +01:00
cytopia
8f363ace59 Doc: Fixed heading level 2022-12-08 07:26:28 +01:00
cytopia
0fb753511a Streamlined repository helper binaries 2022-12-08 07:26:14 +01:00
cytopia
28b7aade7f Ensure mhsendmail is available on arm64 2022-12-08 06:23:53 +01:00
cytopia
3db1b56b7b Temporarily disable modules for faster builds 2022-12-08 05:04:34 +01:00
cytopia
4cc5e57f24 Fix slim builds for arm64 2022-12-08 05:02:22 +01:00
cytopia
39b32384b6 Improve PHPUnit install 2022-12-07 19:18:33 +01:00
cytopia
887e7c67c5 Optimize 2022-12-07 18:56:44 +01:00
cytopia
0126289bf0 Split out tools 2022-12-07 16:55:17 +01:00
cytopia
101e8abb65 Add vim modeline 2022-12-07 16:41:34 +01:00
cytopia
69ffc63607 Use a single command to generate Dockerfiles 2022-12-07 12:13:41 +01:00
cytopia
fb5a242965 Speed up Ansible run 2022-12-07 06:54:08 +01:00
cytopia
8d305b3d96 Merge pull request #251 from devilbox/release-0.144
Release 0.144
2022-12-01 21:49:10 +01:00
cytopia
9c4490f820 Fix Redis build and run deps 2022-12-01 10:53:56 +01:00
cytopia
6054f92e9e Updated Changelog 2022-12-01 09:22:57 +01:00
cytopia
f2d1e41377 Added extensions: lz4, lzf and zstd 2022-12-01 09:22:45 +01:00
cytopia
c64e92e94e Added Serializers for Redis ext: lz4, lzf, zstd 2022-12-01 09:21:32 +01:00
cytopia
6e15be18a4 Automate README.md modules generation 2022-12-01 00:37:06 +01:00
cytopia
60555c3556 Add Core extensions 2022-11-30 23:54:29 +01:00
cytopia
65e3676aa6 Fix linting 2022-11-30 19:59:58 +01:00
cytopia
bc19843825 Finalize extension documentation 2022-11-30 19:55:44 +01:00
cytopia
1b047aeee3 Dont <sup> case module section 2022-11-30 18:38:09 +01:00
cytopia
c55e6d4f53 Update modules for PP 8.2 2022-11-30 18:27:31 +01:00
cytopia
5b6e7e7fc9 Update modules for PP 8.0 2022-11-30 18:20:35 +01:00
cytopia
91943783d8 Add basic Extension docs 2022-11-30 08:15:42 +01:00
cytopia
bafc1b2544 Interlink documentations 2022-11-30 06:56:21 +01:00
cytopia
864f7086c8 Add reference implementation in Example section 2022-11-30 06:55:25 +01:00
cytopia
f71ef64238 Update CHANGELOG 2022-11-30 06:55:10 +01:00
cytopia
825bc41054 Add Abuser documentation 2022-11-30 06:38:27 +01:00
cytopia
c722d4cc8f Add info on how to generate your own extensions 2022-11-30 06:26:48 +01:00
cytopia
16f09f8bf6 Be able to parse args to module-generate.py via make 2022-11-30 06:25:02 +01:00
cytopia
b98b2c31b3 Allow to ignore deps and specify a selection of modules 2022-11-30 06:24:42 +01:00
cytopia
ab5264d5be Update contributor docs 2022-11-30 03:29:08 +01:00
cytopia
7101c8c07c Fix docker run 2022-11-30 03:18:01 +01:00
cytopia
f00077a126 Finalize Contibutors documentation 2022-11-30 03:05:46 +01:00
cytopia
bf3dffc5b4 Make available PHP versions more fancy 2022-11-30 02:00:48 +01:00
cytopia
c76b220e4f Be more verbose on failed module generation 2022-11-30 02:00:27 +01:00
cytopia
ab9a3e188f Fix linting 2022-11-30 01:30:29 +01:00
cytopia
76d33f468f Update CHANGELOG 2022-11-30 01:28:31 +01:00
cytopia
f6c47da969 Polish README 2022-11-30 01:28:20 +01:00
cytopia
4fa108269e Fix Linting 2022-11-30 01:21:34 +01:00
cytopia
9db2f78914 Adjust documentation 2022-11-30 01:04:24 +01:00
cytopia
e40b801139 Restructure documentation 2022-11-30 00:46:27 +01:00
cytopia
54831fd444 Adjust PHP module generation for README 2022-11-30 00:45:02 +01:00
cytopia
04e7c24f3a Update README 2022-11-29 06:57:18 +01:00
cytopia
e199124ca6 Add documentation directory 2022-11-29 06:51:50 +01:00
cytopia
f26b491e5f Fix yamllint warning 2022-11-29 06:24:33 +01:00
cytopia
f45e004a2f Fix Ansible version in Makefile 2022-11-29 06:23:03 +01:00
cytopia
111756d4ae Ensure Python packages are avail on linting stage 2022-11-29 06:16:12 +01:00
cytopia
01126fb861 Fix xdebug on PHP 8.2 2022-11-29 06:04:58 +01:00
cytopia
e589728280 Ensure to check against generated modules 2022-11-29 05:51:15 +01:00
cytopia
67a7704c56 Exclude PHP 5.2 from sqlite3 2022-11-29 05:47:30 +01:00
cytopia
5ca99aebc8 Fix build mod 2022-11-29 05:09:33 +01:00
cytopia
3cf353abae Add new target 2022-11-29 05:08:34 +01:00
cytopia
566dba9b1e Fix linting 2022-11-29 05:03:07 +01:00
cytopia
63598496fe Update Dockerfiles 2022-11-29 04:49:27 +01:00
cytopia
52aa0d4d42 Add PHP module dirs 2022-11-29 04:48:37 +01:00
cytopia
40c6d485cc Adjust repo files 2022-11-29 04:48:35 +01:00
cytopia
d7db5dc72a Adjust paths in gitignore 2022-11-29 04:47:17 +01:00
cytopia
2ad29a8c3e Adjust paths in Ansible comments 2022-11-29 04:47:16 +01:00
cytopia
df09f78b38 Adjust paths in Makefile 2022-11-29 04:47:16 +01:00
cytopia
0fbc57c154 Restructured PHP extensions 2022-11-29 04:47:14 +01:00
cytopia
c991ca9eaa Adjust code to linting 2022-11-29 04:45:45 +01:00
cytopia
bd9aac8cba Nicyfy get-modules.py 2022-11-29 04:45:45 +01:00
cytopia
873bcce2e7 Cleanup module dependency fetcher 2022-11-29 04:45:45 +01:00
cytopia
bc0a08ce2f Module parser 2022-11-29 04:45:44 +01:00
cytopia
cb046ddd2b Merge pull request #250 from devilbox/release-0.143
Added phalcon 5.x to PHP 8.0 and PHP 8.1
2022-11-27 23:44:14 +01:00
cytopia
e687ad15f2 Added phalcon 5.x to PHP 8.0 and PHP 8.1 2022-11-27 13:39:13 +01:00
cytopia
70e3fc68ba Merge pull request #249 from devilbox/release-0.142
Release 0.142
2022-11-21 10:38:33 +01:00
cytopia
e6564db96d Disable Phalcon Devtools for PHP 7.4 as it breaks 2022-11-21 00:49:41 +01:00
cytopia
b90a13482d Fix postgreSQL install on PHP 7.0 2022-11-21 00:36:21 +01:00
cytopia
397175aec8 Fix postgreSQL install on PHP 5.6 2022-11-21 00:27:49 +01:00
cytopia
90f5abc2fd Ensure to pull correct base image prior build 2022-11-20 11:58:02 +01:00
cytopia
79f087e21a Fixed installation of NodeJS 2022-11-20 11:57:41 +01:00
cytopia
b08e7d5c02 Trigger Build 2022-11-20 11:10:28 +01:00
cytopia
0a71f838f2 Update CHANGELOG 2022-11-19 20:33:39 +01:00
cytopia
7e3db52406 Fix build of phalcon 2022-11-19 20:31:41 +01:00
cytopia
05d8edb2fe Fix Phalcon versions 2022-11-19 20:31:41 +01:00
cytopia
a671401bf2 Trigger build 2022-11-19 20:31:40 +01:00
cytopia
0d11c229d4 Empty-Commit 2022-11-19 20:31:40 +01:00
cytopia
20f87ad3ce Fix workflow syntax errors 2022-11-19 20:31:40 +01:00
cytopia
8a7ca18897 Merge pull request #246 from mrLexx/bugfix/drupalconsole
drupalconsole the old way of get DURL was wrong
2022-11-19 20:31:14 +01:00
cytopia
59b1197c75 Merge branch 'master' into bugfix/drupalconsole 2022-11-19 20:30:35 +01:00
cytopia
12e51113a6 Merge pull request #245 from mrLexx/bugfix/wkhtmltopdf
wkhtmltopdf new way of install (from wkhtmltopdf/packaging)
2022-11-19 20:28:11 +01:00
cytopia
40c2db6633 Merge branch 'master' into bugfix/wkhtmltopdf 2022-11-19 20:25:47 +01:00
cytopia
b4bfb84dcf Merge pull request #247 from mrLexx/bugfix/symfony-cli
symfony cli new way of install (from symfony-cli/symfony-cli)
2022-11-19 20:21:48 +01:00
Valeriy
b7a52ff1bd wkhtmltopdf new way of install (from wkhtmltopdf/packaging) 2022-10-05 17:14:33 +03:00
Valeriy
9df90b3500 symfony cli new way of install (from symfony-cli/symfony-cli) 2022-10-05 17:11:59 +03:00
Valeriy
0bdc196f43 drupalconsole the old way of get DURL was wrong 2022-10-05 17:09:51 +03:00
cytopia
14f9ebe3b8 Merge pull request #243 from devilbox/release-0.141
Release 0.141
2022-07-04 11:02:50 +02:00
cytopia
e0cb0c1f5d Adjust permission during build time instead of run-time 2022-07-03 12:41:21 +02:00
cytopia
4b9739a99d Fixed correct permission for /opt/nvm during startup 2022-07-01 15:29:40 +02:00
cytopia
9cbb2d3ddb Merge pull request #241 from devilbox/release-0.140
Release 0.140
2022-05-15 03:07:15 +02:00
cytopia
82f9bc2c86 Update CHANGELOG 2022-05-14 11:53:44 +02:00
cytopia
4ab9fff38b Ensure old Jessie repositories are trusted beyond EOL 2022-05-14 11:52:45 +02:00
cytopia
73734b4481 Merge pull request #239 from devilbox/release-0.139
Release 0.139
2022-04-05 23:15:34 +02:00
cytopia
3610e5f602 Fix PHP 5.6 and 7.0 work images 2022-04-05 13:17:52 +02:00
cytopia
a425b5fd82 Fix install errors 2022-04-05 01:47:49 +02:00
cytopia
e02e7781c7 Streamline amd64 images 2022-04-04 17:56:06 +02:00
cytopia
b42b7789df Use buildkit to build docker images 2022-04-03 15:56:09 +02:00
cytopia
70a19575bb Updated CHANGELOG 2022-04-03 15:55:28 +02:00
cytopia
e34a8a8792 Added postgresql command line client for PHP 7.1+ 2022-04-03 15:55:14 +02:00
cytopia
7ed35f19a9 Update changelog 2022-04-03 14:52:06 +02:00
cytopia
573d5fa2e2 Added mongodb command line client 2022-04-03 14:50:58 +02:00
cytopia
17b98f785c Separate nightly workflows 2022-04-03 14:26:08 +02:00
cytopia
46faa83583 Speed up xargs commands 2022-04-03 13:55:12 +02:00
cytopia
a23cdcdfd0 Merge pull request #237 from devilbox/release-0.138
WIP: Release 0.138
2022-04-02 04:08:18 +02:00
cytopia
b6883cf4be Speed up work builds 2022-04-01 16:16:27 +02:00
cytopia
8334b38869 Remove newline from input params 2022-04-01 02:42:59 +02:00
cytopia
ed40a191df Ensure GH actions trigger are described 2022-04-01 02:26:28 +02:00
cytopia
107b39f5a2 Adjust nightly schedule 2022-04-01 02:04:07 +02:00
cytopia
0b6187fe37 Added swoole module for PHP 8.1 2022-03-31 16:38:55 +02:00
cytopia
b9efb7b1c3 Fix composer install 2022-03-31 15:08:04 +02:00
cytopia
f9a5db2cee Rename workflows 2022-03-31 03:22:08 +02:00
cytopia
2471921a2a Fix composer install 2022-03-31 02:22:54 +02:00
cytopia
fd44d5a2ef Have COPY statements at the end of Dockerfiles 2022-03-31 01:33:32 +02:00
cytopia
e9852d26d8 Include all images 2022-03-30 15:10:30 +02:00
cytopia
465a0284c0 Always clean up after installation 2022-03-30 14:35:06 +02:00
cytopia
c906ff09e0 Cleanup work image 2022-03-30 14:05:51 +02:00
cytopia
ee7b55fc0f Use composer v1 for PHP 5.3 2022-03-30 13:59:08 +02:00
cytopia
cbc27ffffd Cleanup cache in worker images 2022-03-30 13:57:42 +02:00
cytopia
f5f22904fb Have tests run in parallel job 2022-03-30 13:52:42 +02:00
cytopia
b5467210e1 variablize nvm install directory 2022-03-30 13:40:37 +02:00
cytopia
b681725fa5 Ignore PR builds for myself 2022-03-30 13:21:36 +02:00
cytopia
1b02bd11fe Clean GitHub Actions 2022-03-30 13:09:30 +02:00
cytopia
476a1dee47 Fix composer version check 2022-03-30 12:46:07 +02:00
cytopia
8213301902 Remove manual yarn install 2022-03-30 12:07:58 +02:00
cytopia
ca544c19d2 Workflow deps 2022-03-30 11:18:02 +02:00
cytopia
180edab57f Use modern way to install node & yarn 2022-03-30 11:15:46 +02:00
cytopia
a2b50e69fd Allow for more parallel runs 2022-03-30 01:33:40 +02:00
cytopia
b51e640932 Distinguish between flavour and stage 2022-03-30 01:31:28 +02:00
cytopia
d8eccbf21a Use STAGE instead of FLAVOUR 2022-03-30 01:00:56 +02:00
cytopia
4176a5dd70 Fix booleans 2022-03-30 00:44:09 +02:00
cytopia
83cc953e55 Test few versions 2022-03-30 00:13:32 +02:00
cytopia
d0949e3fe9 Remove enabled flag 2022-03-30 00:11:48 +02:00
cytopia
ab8a549764 Update deps 2022-03-29 20:57:00 +02:00
cytopia
d26e6221c4 Outsource push action 2022-03-29 20:54:00 +02:00
cytopia
07267f20d0 Unify workflows 2022-03-29 20:11:39 +02:00
cytopia
0e4f51c82d Simplify install of vips 2022-03-29 02:16:40 +02:00
cytopia
c35c942bf8 Add support for arm64 2022-03-28 18:58:11 +02:00
cytopia
a02163b6c1 Merge pull request #236 from devilbox/ci-build-test-separation
Separate build and test jobs for CI
2022-03-28 16:56:08 +02:00
cytopia
35a3a9a486 Fix curl commands 2022-03-28 13:27:04 +02:00
cytopia
b72f81edd9 Only outsource test for mods due to long run-time 2022-03-28 13:23:16 +02:00
cytopia
a47265e482 Re-add all job dependencies 2022-03-28 13:03:45 +02:00
cytopia
880a6f17b8 Change Workflow dependency 2022-03-28 12:59:38 +02:00
cytopia
b224ecfdd7 Separate build and test jobs for CI 2022-03-27 20:58:01 +02:00
cytopia
c17e49b849 Merge pull request #235 from devilbox/workflow-dispatch
Allow workflows to be manually dispatched
2022-03-27 20:36:41 +02:00
cytopia
9a981de73f Allow workflows to be manually dispatched 2022-03-27 18:37:27 +02:00
cytopia
beeff54815 allow to manually trigger workflow 2022-03-27 04:33:13 +02:00
cytopia
6cb03a9890 Merge pull request #234 from devilbox/cytopia-patch-1
Allow to manually trigger workflow
2022-03-27 04:31:21 +02:00
cytopia
0dc4bd6959 Allow to manually trigger workflow 2022-03-27 04:29:46 +02:00
cytopia
a8c3f2c655 Allow to manually trigger workflow 2022-03-27 04:28:57 +02:00
cytopia
2655813ab8 Merge pull request #233 from devilbox/nightly-jobs
Separate nightly jobs
2022-03-27 01:14:27 +01:00
cytopia
0011b2e6ed Separate nightly jobs 2022-03-26 19:30:43 +01:00
cytopia
52c1a907f9 Merge pull request #232 from devilbox/release-0.137
Release 0.137
2022-03-26 15:41:05 +01:00
cytopia
e19d955965 Fix linting pipeline 2022-03-26 13:53:00 +01:00
cytopia
c0af9f91a6 Update CHANGELOG 2022-03-26 13:49:04 +01:00
cytopia
5f8551e742 Finalize new pipelines 2022-03-26 13:47:53 +01:00
cytopia
b774432a7a Re-enable tests 2022-03-26 13:47:07 +01:00
cytopia
e856fe1da4 Verify docker save 2022-03-26 01:32:07 +01:00
cytopia
1ed1c7eb81 Add test download 2022-03-26 01:16:44 +01:00
cytopia
756b6bc0fe Integrate retry for upload artifact 2022-03-26 00:54:48 +01:00
cytopia
4e9969ef75 Fix if condition 2022-03-25 21:57:31 +01:00
cytopia
1b67f7b02d Fix action name 2022-03-25 21:47:12 +01:00
cytopia
9fda4fd0a2 Use verifyer to upload artifacts 2022-03-25 21:43:19 +01:00
cytopia
4858303a1b Remove limited retries 2022-03-25 19:38:51 +01:00
cytopia
2e3115ef04 Use retry for artifact download 2022-03-25 19:31:19 +01:00
cytopia
8989b52602 Use shorter build names 2022-03-25 17:25:32 +01:00
cytopia
ee6b735f17 Fix test-case 2022-03-25 17:23:43 +01:00
cytopia
20b45a0b79 Remove non-existing matrix var 2022-03-25 16:49:52 +01:00
cytopia
687969b59b Separate PHP 5.2 2022-03-25 16:24:00 +01:00
cytopia
111c8a412f Enable all versions 2022-03-25 16:21:08 +01:00
cytopia
1d27f22e3f Organize workflow files 2022-03-25 16:17:50 +01:00
cytopia
4b8668623b Test with am64 only 2022-03-25 15:55:22 +01:00
cytopia
7b7a680e0b Test manifest 2022-03-25 15:52:31 +01:00
cytopia
49d9459df8 Ensure deploy tag is present 2022-03-25 15:36:59 +01:00
cytopia
efad9eaa48 Fix paths 2022-03-25 15:33:07 +01:00
cytopia
22231fc61c Fix deploy 2022-03-25 15:31:52 +01:00
cytopia
f971d8d4b8 Limit retries 2022-03-25 15:18:32 +01:00
cytopia
5498275047 Fix makefile 2022-03-25 15:15:51 +01:00
cytopia
a6f9bd8219 Test deploy 2022-03-25 15:04:43 +01:00
cytopia
ea47aa2ba5 Streamline build 2022-03-25 15:02:20 +01:00
cytopia
5094da0ae6 Build correct flavour 2022-03-25 14:16:24 +01:00
cytopia
38d4f0c222 Disable debug 2022-03-25 14:12:05 +01:00
cytopia
853962c4e9 Set outputs 2022-03-25 14:11:23 +01:00
cytopia
8d50798d54 Show more outputs 2022-03-25 14:04:32 +01:00
cytopia
b50a688add show debug 2022-03-25 14:01:09 +01:00
cytopia
99bd1d2cdb Add debug stage 2022-03-25 13:47:01 +01:00
cytopia
ac368b8725 Fix missing char 2022-03-25 13:40:34 +01:00
cytopia
c815e9040c Fix workflow 2022-03-25 13:39:06 +01:00
cytopia
61ccae6fc1 Fix workflow 2022-03-25 13:37:16 +01:00
cytopia
f7699f9c84 Fix aa build 2022-03-25 13:26:03 +01:00
cytopia
1cab69c0ab Add new workflow 2022-03-25 13:24:56 +01:00
cytopia
2158817a05 Fix Makefile 2022-03-25 13:24:09 +01:00
cytopia
29d34dcdb2 Go full build chain 2022-03-25 01:43:34 +01:00
cytopia
ff04507e50 Dont check if image exists before loading it from disk 2022-03-25 01:30:09 +01:00
cytopia
a448549b82 Make artifact name unique 2022-03-25 01:23:45 +01:00
cytopia
e808575164 Add generic flavour 2022-03-25 01:16:19 +01:00
cytopia
643e1a7478 Pick fast builder 2022-03-25 01:14:48 +01:00
cytopia
f3758cec56 Build mods 2022-03-25 01:13:18 +01:00
cytopia
ec5d6734fa Remove tests for now 2022-03-25 01:02:46 +01:00
cytopia
ab91e0794b Fix Makefile 2022-03-25 01:02:33 +01:00
cytopia
b6f926cf8a Fix tests 2022-03-25 00:53:26 +01:00
cytopia
1609e8ea61 Fix Makefile 2022-03-25 00:50:24 +01:00
cytopia
389e0bad20 Fix tests 2022-03-25 00:50:11 +01:00
cytopia
e48ceef4a6 Fix Makefile 2022-03-25 00:37:53 +01:00
cytopia
b659089ff9 Fix git cmd 2022-03-25 00:32:41 +01:00
cytopia
e8e92eceb7 Fix reusable workflow 2022-03-25 00:30:50 +01:00
cytopia
14c25cf670 Try out new workflow run 2022-03-25 00:29:07 +01:00
cytopia
8679dbee6a Give some additional startup time 2022-03-24 18:07:43 +01:00
cytopia
6ccf44b5a9 Fix README generation test 2022-03-24 17:37:02 +01:00
cytopia
2826053fc0 Probe for test email repeatedly 2022-03-24 17:31:05 +01:00
cytopia
1eb30660a6 CI: Limit retries on failure 2022-03-24 13:03:12 +01:00
cytopia
81ef92f91e Test: Better check to see if PHP-FPM is running 2022-03-24 13:02:49 +01:00
cytopia
663f716031 Removed Ansible due to arm64 issues 2022-03-23 21:32:01 +01:00
cytopia
ea52cc0969 Fix mysql CI test 2022-03-23 15:28:13 +01:00
cytopia
ee14a4d46e Fix base/ tests for quemu envs 2022-03-23 14:15:57 +01:00
cytopia
d894a2bff7 Fix work/ integration tests 2022-03-23 14:12:00 +01:00
cytopia
cdfca15613 Fix work/ tests 2022-03-23 13:36:21 +01:00
cytopia
d1061273b0 Fix prod/ tests 2022-03-23 13:27:02 +01:00
cytopia
1c31dbe3bf tests: update headlines 2022-03-23 13:26:28 +01:00
cytopia
7975126bdf tests: adjust container startup waiting time 2022-03-23 13:26:10 +01:00
cytopia
ffaee357fd Fix mods/ tests 2022-03-23 12:03:43 +01:00
cytopia
a0e7ae7131 Fix base/ tests 2022-03-23 11:51:19 +01:00
cytopia
7041e6ef0a Adjust CI tests 2022-03-23 11:26:50 +01:00
cytopia
176f48d063 Fix mhsendmail install 2022-03-23 00:27:00 +01:00
cytopia
dc15215156 Optimize images 2022-03-23 00:15:08 +01:00
cytopia
7693a4ea3f Removed mongodb cmd client and apt repositories due to arm64 issues 2022-03-22 23:20:19 +01:00
cytopia
4ac5a7ab10 Fix broken software on non-amd64 platforms 2022-03-22 23:17:53 +01:00
cytopia
2b60cd648d Removed postgres cmd client and apt repositories due to arm64 issues 2022-03-22 23:01:15 +01:00
cytopia
492d23b9f8 Removed homebrew due to arm64 issues 2022-03-22 22:58:08 +01:00
cytopia
b852001495 Enable arm64 tests in CI 2022-03-22 22:52:30 +01:00
cytopia
5eb8ce8187 Ensured CI tests are platform agnostic (amd64 vs arm64) 2022-03-22 22:50:11 +01:00
cytopia
d1fd0addaa Update nightly tag 2022-03-22 22:21:10 +01:00
cytopia
0aceceabda Fixed imklog: cannot open kernel log (/proc/kmsg): Operation not permitted. 2022-03-22 22:20:17 +01:00
cytopia
42933391b6 Test arm64 builds 2022-03-22 12:39:38 +01:00
cytopia
436babd549 Merge pull request #231 from devilbox/release-0.136
Release 0.136
2022-03-21 22:16:40 +01:00
cytopia
abfeef2e5c Remove testing files 2022-03-21 22:15:33 +01:00
cytopia
896c8f6c80 Fix soap module build for PHP 7.4 2022-03-21 19:15:03 +01:00
cytopia
7f71dd2493 Update PHP modules in README 2022-03-21 19:14:43 +01:00
cytopia
8318b43d2f Ensure to check against mhash module 2022-03-21 16:31:17 +01:00
cytopia
6a00f19e88 Fix snmp module for PHP 7.4 2022-03-21 16:22:06 +01:00
cytopia
e97261bc87 Update PHP modules in README 2022-03-21 16:18:48 +01:00
cytopia
06ac183215 Fix build for PHP 7.0 2022-03-21 15:39:26 +01:00
cytopia
0181f196f6 Update module section 2022-03-21 15:23:33 +01:00
cytopia
4e5da07e21 Make install of symfony cli platform independent 2022-03-21 15:21:24 +01:00
cytopia
6c6470c181 Fix build 2022-03-21 14:59:34 +01:00
cytopia
80f03e7512 Integrate new PHP-FPM images 2022-03-21 12:02:09 +01:00
cytopia
157945dada Fix syntax error 2022-03-18 18:41:13 +01:00
cytopia
116aa387fb Changed PHP 5.5 to Debian stretch 2022-03-18 13:35:03 +01:00
cytopia
e33041ca55 Switch PHP 5.5 base image to devilbox/php-fpm-5.5 for arm64 support 2022-03-18 12:59:38 +01:00
cytopia
2d489beb2c Test arm64 builds 2022-03-18 12:22:37 +01:00
cytopia
cb9437b4f3 Updated CHANGELOG 2022-03-18 12:22:22 +01:00
cytopia
9505770a8c Update nightly 2022-03-18 12:22:06 +01:00
cytopia
919a6887a6 Removed amqp on PHP 5.3 2022-03-18 12:21:37 +01:00
cytopia
b352de6939 Fixed install of mongodb-org-shell and mongodb-org-tools 2022-03-18 12:19:00 +01:00
cytopia
456447070a Merge pull request #230 from devilbox/release-0.135
Release 0.135
2022-03-18 12:07:36 +01:00
cytopia
ac508caee4 Remove arm64 test 2022-03-18 01:23:47 +01:00
cytopia
6b4596688c Removed codeception from PHP 5.3 2022-03-18 01:19:10 +01:00
cytopia
98569594bf Make alien respect architecture 2022-03-17 23:09:35 +01:00
cytopia
8b9dbdf36b Fix build of wkhtmltopdf 2022-03-17 22:08:45 +01:00
cytopia
fdc024fac3 Fix debs for PHP 5.2 and PHP 5.3 2022-03-17 21:05:17 +01:00
cytopia
f36d0818b0 Removed ioncube extension for PHP 5.2, PHP 5.3 and PHP 5.4 2022-03-17 20:29:46 +01:00
cytopia
361192deee Fix debs for PHP 5.2 and PHP 5.3 2022-03-17 20:22:23 +01:00
cytopia
b937b99641 Fix syntax error 2022-03-17 18:49:20 +01:00
cytopia
a7b96c7cf5 Disable PHP 5.2 in arm64 builds 2022-03-17 18:39:31 +01:00
cytopia
45e25586e3 Removed mongodb extension from PHP 5.3 due to build errors 2022-03-17 18:39:15 +01:00
cytopia
df59c7b7bc Show commands used in Makefile 2022-03-17 18:35:37 +01:00
cytopia
c18bac4387 Ensure dpkg-dev is installed 2022-03-17 18:26:47 +01:00
cytopia
0239ff0a78 Fix ioncube architecture install 2022-03-17 17:59:11 +01:00
cytopia
02c8c9d6ec Variablize architecture 2022-03-17 17:24:18 +01:00
cytopia
207b78df6f Fix gd build for PHP 5.2 and PHP 5.3 2022-03-17 16:55:34 +01:00
cytopia
20c5b88e52 Fix amqp extension for PHP 5.2 2022-03-17 16:52:42 +01:00
cytopia
5585109fb8 Variablize Docker platform 2022-03-17 16:36:13 +01:00
cytopia
2517c33bae Removed photoncms binaries (their GitHub organization went private) 2022-03-17 16:09:07 +01:00
cytopia
b0c487ff28 Test ARM64 builds 2022-03-17 15:54:19 +01:00
cytopia
e16fdce860 Use correct run_deps for Debian version 2022-03-17 15:44:26 +01:00
cytopia
31489459ad Ensure mkdir does not fail if directory already exists 2022-03-17 15:39:31 +01:00
cytopia
64e290a359 Update nightly workflow 2022-03-17 15:22:25 +01:00
cytopia
e145f9cec8 Fixed pidof issue on QUEMU by replacing it with pgrep 2022-03-17 15:12:39 +01:00
cytopia
40ac8e4ef0 Fixed cloning of gitflow 2022-03-17 14:59:54 +01:00
cytopia
1640850b75 Changed PHP 5.2 and PHP 5.3 base images to Debian stretch 2022-03-17 14:55:22 +01:00
cytopia
42a0a4f7ac Merge pull request #226 from devilbox/release-0.134
Release 0.134
2022-02-03 19:10:23 +01:00
cytopia
69689351c8 Update project files 2022-02-03 14:33:51 +01:00
cytopia
865f18a212 Add extension xdebug to PHP 8.2 2022-02-03 14:33:27 +01:00
cytopia
f0b758e5fc Merge pull request #225 from devilbox/release-0.133
Release 0.133
2022-02-03 00:44:18 +01:00
cytopia
d3e642b5f6 Add PHP 8.2 2022-02-02 12:39:31 +01:00
cytopia
928c712fa6 Merge pull request #224 from devilbox/release-0.132
Release 0.132
2022-02-02 09:36:19 +01:00
cytopia
c818efe5e3 Change postfix hostname to localhost 2022-02-01 23:38:35 +01:00
cytopia
ec1a1bd79d Update CHANGELOG 2022-02-01 21:07:01 +01:00
cytopia
184881a8c5 Add pdo_sqlsrv and sqlsrv to PHP 8.1 2022-02-01 21:06:37 +01:00
cytopia
1782f24d03 Updated CHANGELOG 2022-02-01 20:08:46 +01:00
cytopia
4cee51dbf4 Fixed nvm PATH priority 2022-02-01 20:08:32 +01:00
cytopia
fbcd91f248 Update nightly tag 2022-02-01 00:22:08 +01:00
cytopia
d2cb8ef2c3 Ensure postfix has a default hostname 2022-02-01 00:21:43 +01:00
cytopia
f3e7f5d352 Merge pull request #223 from devilbox/release-0.131
Release 0.131
2022-01-27 00:36:49 +01:00
cytopia
d3923eb359 Update nightly workflow 2022-01-26 18:57:11 +01:00
cytopia
9a24cfe917 Fix GD AVIF CI test 2022-01-26 16:37:33 +01:00
cytopia
0229adf7c1 Fix uuid module version 2022-01-26 15:33:34 +01:00
cytopia
c35262e9b8 Update php-cs-fixer 2022-01-26 14:25:39 +01:00
cytopia
17649294c2 Added extension rdkafka to PHP 8.0 and PHP 8.1 2022-01-26 13:51:13 +01:00
cytopia
2d428c264a Added extension: uuid 2022-01-26 13:40:02 +01:00
cytopia
72d34ca52f Added imagick extension for PHP 8.0 and PHP 8.1 2022-01-26 13:20:37 +01:00
cytopia
6fbbc9580f Added pdo_dblib extension for PHP 8.1 2022-01-26 13:13:44 +01:00
cytopia
44cc0093ec Use pecl to install uploadprogress 2022-01-26 13:07:24 +01:00
cytopia
881dd567c9 Added uploadprogress extension for PHP 8.0 and PHP 8.1 2022-01-26 13:02:54 +01:00
cytopia
2184f1f9a0 Added xlswriter extension for PHP 8.1 2022-01-26 12:59:06 +01:00
cytopia
e10f81915b Added amqp extension for PHP 8.0 and PHP 8.1 2022-01-26 12:50:56 +01:00
cytopia
9fbdc187d8 Added amqp extension for PHP 8.0 and PHP 8.1 2022-01-26 12:47:31 +01:00
cytopia
1261f3a700 Added sqlite3 binary to all PHP images 2022-01-26 12:34:04 +01:00
cytopia
015eaff5d0 Enable AVIF support in GD for PHP 8.1 2022-01-26 12:27:46 +01:00
cytopia
b5c34feb7c Merge pull request #222 from devilbox/release-0.130
Release 0.130
2022-01-24 18:10:29 +01:00
cytopia
61ee6b3bfb Ensure apt update works on final images 2022-01-24 16:00:26 +01:00
cytopia
feb6f0fee8 Merge pull request #221 from devilbox/release-0.129
Release 0.129
2022-01-24 00:02:29 +01:00
cytopia
40c3980b3e Adjust CI tests for enchant 2022-01-23 22:08:10 +01:00
cytopia
857900acc6 Update CHANGELOG 2022-01-23 19:08:31 +01:00
cytopia
7aa26f96d0 Fix run-dep for ffi on PHP 7.4 2022-01-23 19:08:06 +01:00
cytopia
70ab96876d Update CHANGELOG 2022-01-23 19:00:10 +01:00
cytopia
666980dc1c Update pip to use Python3 for PHP >= 7.3 2022-01-23 18:39:51 +01:00
cytopia
b776a9110f Update PostgreSQL repos to Bullseye for PHP >= 7.3 2022-01-23 18:33:06 +01:00
cytopia
d1ec52838a Be a bit more verbose during apt-get commands 2022-01-23 18:19:25 +01:00
cytopia
8d8c92657a Fixed building ffi on PHP 7.4 2022-01-23 18:12:24 +01:00
cytopia
7a2710ffc5 Fix apt package versions 2022-01-23 18:11:56 +01:00
cytopia
58751d8deb Updated CHANGELOG 2022-01-23 16:25:31 +01:00
cytopia
3d96f15958 Updated nightly tag 2022-01-23 16:25:08 +01:00
cytopia
c8c71fb115 Removed enchant from PHP 7.3 and PHP 7.4 as libenchant1 is not available via apt 2022-01-23 16:23:30 +01:00
cytopia
e156582252 Fixed building sockets on PHP 8.0 and PHP 8.1 2022-01-23 16:18:26 +01:00
cytopia
ae9d987cb9 Fixed php-cs-fixer download on cert issues 2022-01-23 15:36:19 +01:00
cytopia
7b68744404 Do not hide curl errors during build stage 2022-01-23 14:55:12 +01:00
cytopia
c3ad81b808 Fixed phpunit download on cert issues 2022-01-23 14:50:26 +01:00
cytopia
9531a29533 Fixed phpmd download on cert issues 2022-01-23 14:40:18 +01:00
cytopia
ed3449af98 Fixed deployer.org download on cert issues 2022-01-23 14:37:25 +01:00
cytopia
5a5bcb1644 Disabled mcrypt for PHP 8.1 as not yet supported 2022-01-23 13:41:57 +01:00
cytopia
b0d72726bf Fixed pgsql apt keys 2022-01-23 13:27:10 +01:00
cytopia
9f073247f8 Ensure versions are pinned 2022-01-23 11:42:05 +01:00
cytopia
49e3180891 Merge pull request #212 from fibis/master
Add module swoole in php 8.0
2021-06-16 10:09:16 +02:00
cytopia
b4df3bc119 Update CHANGELOG 2021-06-15 21:16:17 +02:00
cytopia
5aeeb86210 Update nightly workflow tag 2021-06-15 21:14:15 +02:00
Adriaan Wind
0421750699 update readme 2021-06-15 18:30:32 +02:00
Adriaan Wind
36ef04c0f6 add swoole the correct way 2021-06-15 17:22:58 +02:00
cytopia
b0c3afc0d4 Merge pull request #208 from devilbox/release-0.127
Release 0.127
2021-05-28 02:56:47 +02:00
cytopia
5ddf4a044a Fix README 2021-05-27 19:45:03 +02:00
cytopia
32a7cee28c Update README 2021-05-27 18:30:35 +02:00
cytopia
1b12438855 Update nightly tag 2021-05-27 18:30:23 +02:00
cytopia
c40619c7c0 Add module: (pdo_)sqlsrv 2021-05-27 13:27:22 +02:00
cytopia
d97348f457 Merge pull request #207 from devilbox/release-0.126
Release v0.126
2021-05-26 10:19:57 +02:00
cytopia
f86556c72d Added Homebrew 2021-05-26 08:09:34 +02:00
cytopia
8e94d09e39 Merge pull request #206 from llaville/feature/homebrew
Add Homebrew to replace Linuxbrew
2021-05-26 08:08:10 +02:00
Laurent Laville
7df4f04a04 add Homebrew to replace Linuxbrew (deprecated and removed) 2021-05-21 18:14:43 +02:00
Laurent Laville
0c664d770e Merge pull request #3 from devilbox/master
Sync Forked Repo
2021-05-21 16:10:54 +02:00
cytopia
e087ed33cc Merge pull request #205 from devilbox/release-0.125
Release 0.125
2021-05-19 22:57:13 +02:00
cytopia
2ac845ab74 Update project files 2021-05-19 21:43:25 +02:00
cytopia
6634169b3f Pin wp-cli version for PHP 5.4 and 5.5 2021-05-19 21:43:09 +02:00
cytopia
f9113317fc Replace wget with curl for header download 2021-05-19 20:27:20 +02:00
cytopia
518d0d908d Pin Ansible to specific version 2021-05-19 20:09:42 +02:00
cytopia
58aa3c6abf Update workflows 2021-05-19 19:48:22 +02:00
cytopia
8d89ed4b02 Re-added opcache for PHP 8.1 2021-05-19 19:46:01 +02:00
cytopia
25e0e12fe9 Merge pull request #204 from devilbox/release-0.124
Release 0.124
2021-05-17 16:12:45 +02:00
cytopia
15ff7ff2dc Fix: add missing .so ext to mod load 2021-05-17 13:59:51 +02:00
cytopia
36a3016370 Ensure to have phalcon ext on while verifying phalcon tools 2021-05-16 19:18:42 +02:00
cytopia
bf81b816c4 Fix drupal builds for PHP 7.0 and 7.1 2021-05-16 17:31:28 +02:00
cytopia
a6e27c1dcd Fix work issues for PHP 7.0 and 7.1 2021-05-16 17:04:11 +02:00
cytopia
712ad5c66a Fix all work images 2021-05-16 16:49:14 +02:00
cytopia
59c30b8f24 Fix all mods images 2021-05-16 14:41:01 +02:00
cytopia
d903951329 Fix broken builds 2021-05-16 13:03:39 +02:00
cytopia
89d71a694b Fixed linting 2021-05-16 12:18:21 +02:00
cytopia
1d3a03c389 Disable linuxbrew 2021-05-16 12:14:45 +02:00
cytopia
bc526403dd Fix Ansible generation 2021-05-16 12:12:58 +02:00
cytopia
282c019eb3 Merge pull request #191 from devilbox/release-0.123
Release 0.123
2020-12-19 15:56:53 +01:00
cytopia
74030c5c91 xdebug: set start_with_request to default 2020-12-19 11:07:45 +01:00
cytopia
6be20c28e6 Fixed PHP Xdebug v3 defaults 2020-12-19 10:16:46 +01:00
cytopia
28d7ab632e Merge pull request #190 from devilbox/release-0.122
Release 0.122
2020-12-12 16:44:49 +01:00
cytopia
395e4d30b4 Repository settings 2020-12-12 15:24:52 +01:00
cytopia
d93387f207 Adjust Readme to reflect GitHub Actions 2020-12-12 15:18:21 +01:00
cytopia
c5e3e7257f Update CHANGELOG 2020-12-12 15:14:40 +01:00
cytopia
0f7ea87328 Enable push to Dockerhub 2020-12-12 15:13:50 +01:00
cytopia
66b7586eae Add linting 2020-12-12 15:12:52 +01:00
cytopia
2d4c8647e1 Remove travis.yml config 2020-12-12 14:36:49 +01:00
cytopia
f0bb67cbc2 Ensure to pull latest base images during CI 2020-12-12 14:34:10 +01:00
cytopia
1b312bce33 Fix Docker image tags 2020-12-12 14:24:56 +01:00
cytopia
6aafdd7023 Fix Docker Login 2020-12-12 14:08:10 +01:00
cytopia
48380c5d98 Fix linting job 2020-12-12 14:03:04 +01:00
cytopia
5506d68f1f Fix checkout 2020-12-12 14:01:00 +01:00
cytopia
88aeca57aa Prepare GitHub Actions 2020-12-12 13:57:19 +01:00
cytopia
ec8fc4eab6 Added various extensions to PHP 8.0 and PHP 8.1 2020-12-11 17:08:14 +01:00
cytopia
f6015c766a Added various modules to PHP 8.0 2020-12-11 15:35:42 +01:00
cytopia
f0c625d951 Merge pull request #188 from devilbox/release-0.121
Release 0.121
2020-12-10 13:03:28 +01:00
cytopia
a0332b964e Compile redis with msgpack and igbinary 2020-12-09 12:40:17 +01:00
cytopia
7c1ceabf97 Merge pull request #185 from devilbox/release-0.120
Release 0.120
2020-12-04 18:09:38 +01:00
cytopia
9bc2f1ca31 Fix zsh for PHP 5.6 and 7.0 2020-12-03 09:45:18 +01:00
cytopia
e51d28fcbe Merge pull request #184 from devilbox/release-0.119
Release 0.119
2020-12-01 19:08:03 +01:00
cytopia
a002d3aa19 CI: Added more waiting time in between retries 2020-12-01 11:00:33 +01:00
cytopia
114f1b597d Fixed zsh install for PHP 5.6 and 7.0 2020-12-01 11:00:13 +01:00
cytopia
0b37f92cbb Fixed drupal (drupal console launcher) for PHP 5.5, 5.6, 7.0 and 7.1 2020-12-01 09:45:21 +01:00
cytopia
6616f336cf Merge pull request #183 from devilbox/release-0.118
Release 0.118
2020-11-30 10:56:31 +01:00
cytopia
30f18d858e Fix SLUG and TYPE for GitHub Actions 2020-11-29 13:38:54 +01:00
cytopia
abd10c104b Fix xdebug version for PHP 7.0 2020-11-29 10:48:43 +01:00
cytopia
9f18603b4d Fix typo in git checkout 2020-11-29 09:58:43 +01:00
cytopia
d328e8aa67 Adjust GitHub Actions workflow 2020-11-29 09:58:20 +01:00
cytopia
9bddaad387 Fix GitHub Actions nightly workflow 2020-11-29 09:42:03 +01:00
cytopia
3cdede3519 Fixed mdl rubygem 2020-11-29 09:24:41 +01:00
cytopia
dc98c5cefe Update PHP modules 2020-11-29 09:19:43 +01:00
cytopia
62c65d19e7 Merge pull request #181 from devilbox/release-0.117
Release 0.117
2020-11-21 19:57:59 +01:00
cytopia
b0c7655aca Add custom supervisor config mountpoint 2020-11-21 15:15:02 +01:00
cytopia
6f93613c34 Fix GitHub Actions env vars 2020-11-21 14:46:28 +01:00
cytopia
6f359ab366 Add .composer/vendir/bin to PATH variable 2020-11-21 14:40:05 +01:00
cytopia
add92d6102 Merge pull request #179 from devilbox/release-0.116
Release 0.116
2020-11-13 18:37:08 +01:00
cytopia
cdb09fcbee Fix to disable PHP modules without trailing *.so ext 2020-11-13 12:58:26 +01:00
cytopia
6ecd75d59b Merge pull request #178 from devilbox/release-0.115
Release 0.115
2020-11-13 03:14:23 +01:00
cytopia
04c051e72f Don't fail on uid/gid change 2020-11-13 01:34:56 +01:00
cytopia
d926629879 Allow big uid/gid 2020-11-12 21:19:50 +01:00
cytopia
3ca7d92844 Merge pull request #177 from devilbox/release-0.114
Release 0.114
2020-11-06 21:50:54 +01:00
cytopia
8864095f8b Add PHP 8.1 2020-11-06 15:38:24 +01:00
cytopia
d8be1a89bb Update CHANGELOG 2020-11-06 14:41:43 +01:00
cytopia
b15ae8fc84 Fix bug with gd-jis 2020-11-06 14:05:54 +01:00
cytopia
f3669b1bed Update composer to version 2.x 2020-11-06 13:34:22 +01:00
cytopia
fb36b7151f Re-enable mongodb for PHP 8.0 2020-11-05 12:00:34 +01:00
cytopia
e09e02a7b0 Merge pull request #175 from devilbox/release-0.113
Fix nightly pipeline
2020-09-18 10:46:03 +02:00
cytopia
8f2a9524fe Fix nightly pipeline 2020-09-18 10:45:28 +02:00
cytopia
332d03010c Merge pull request #172 from devilbox/release-0.112
Release 0.112
2020-09-16 03:08:42 +02:00
cytopia
d9b205f2f1 CI: increase retries 2020-09-16 00:26:27 +02:00
cytopia
42df419376 CI: Ensure travis retries during push 2020-09-15 23:25:10 +02:00
cytopia
4be4c2eded More verbose CI output 2020-09-15 18:28:54 +02:00
cytopia
6a49ffce10 Adjust workflows 2020-09-15 15:46:48 +02:00
cytopia
ca6b176620 Fixes #169: Missing locale-gen binary 2020-09-15 15:30:27 +02:00
cytopia
7019b00e55 Fix apt packages for PHP 7.0 2020-09-15 15:30:23 +02:00
cytopia
c40082e886 Added xlswriter extension 2020-09-15 15:30:19 +02:00
cytopia
3f89c534e4 Added vips extension 2020-09-15 15:30:15 +02:00
cytopia
c65bd0653b Fix variables 2020-09-15 15:06:03 +02:00
cytopia
89edcd20d8 Set correct branch/tag 2020-09-15 15:00:32 +02:00
cytopia
fd0594e3c1 Fix GitHub Actions 2020-09-15 14:48:16 +02:00
cytopia
bef26e8c27 Fix checkout 2020-09-15 14:41:55 +02:00
cytopia
f60c0e8fea Fix workflow run 2020-09-15 14:33:45 +02:00
cytopia
1fc03c7b0d Fix workflow file 2020-09-15 14:32:40 +02:00
cytopia
a782cf22ab GitHub Actions Fix schedule 2020-09-15 14:19:06 +02:00
cytopia
51808ccc1b Merge pull request #174 from devilbox/github-actions
Test GitHub actions
2020-09-15 14:05:14 +02:00
cytopia
6f901d4bc7 Test GitHub actions 2020-09-15 14:04:48 +02:00
cytopia
b721b3b5ae Merge pull request #173 from devilbox/github-actions
Test GitHub actions
2020-09-15 13:54:54 +02:00
cytopia
ebd7c5ec37 Test GitHub actions 2020-09-15 13:53:09 +02:00
cytopia
050322cf02 Merge pull request #171 from devilbox/release-0.111
Release v0.111
2020-09-13 15:41:18 +02:00
cytopia
5227af8e4c Re-adding xdebug for PHP 8.0 2020-09-13 11:30:37 +02:00
cytopia
9e247307ad Merge pull request #170 from devilbox/release-0.110
Release v0.110
2020-09-13 11:16:48 +02:00
cytopia
b095b04ec3 Fix laravel symlink location for PHP 7.2 2020-09-12 17:39:20 +02:00
cytopia
5684fac8a2 Fixes laravel installer for PHP 7.2 2020-09-12 12:54:07 +02:00
cytopia
eb6799ad29 Fix download for drupal console 2020-09-12 11:48:21 +02:00
cytopia
1c53a0fd68 Merge pull request #168 from devilbox/release-0.109
Fix absolute path in tests
2020-08-09 14:47:03 +02:00
cytopia
fabc29299c Fix absolute path in tests 2020-08-09 13:07:53 +02:00
cytopia
83b4cb6b43 Merge pull request #167 from devilbox/release-0.108
Release 0.108
2020-08-08 18:11:27 +02:00
cytopia
dc438b0aad Fixes policy.xml for Imagick 2020-08-08 12:16:37 +02:00
cytopia
c8bd21ebbe Update CHANGELOG 2020-08-08 12:03:13 +02:00
cytopia
b2476e3851 Add gsfonts, mupdf and mupdf-tools 2020-08-08 12:02:39 +02:00
cytopia
c06a3d2237 Fix Redis for PHP 8.0 2020-08-08 12:02:04 +02:00
cytopia
ce4f022c70 Update CHANGELOG 2020-08-08 11:12:20 +02:00
cytopia
9c5326dc0f Stricter version check for installed tools 2020-08-08 11:11:35 +02:00
cytopia
2701a524b9 Fixed MongoDB module for PHP 5.6 2020-08-08 11:10:22 +02:00
cytopia
acea0ac0fe Fixed Ansible installation 2020-08-08 11:09:19 +02:00
cytopia
3153b329f1 Added imagick PDF support (via ghostscript) 2020-08-08 11:08:05 +02:00
cytopia
10285279c7 Merge pull request #159 from devilbox/release-0.107
Release 0.107
2020-06-27 23:36:51 +02:00
cytopia
0a04342e46 Adding certbot binary 2020-06-27 18:46:50 +02:00
cytopia
dad684bfd1 Re-added imap for PHP 7.4 2020-06-27 16:23:07 +02:00
cytopia
9fabcf3b71 Fixes imagick segfault by setting its threads to 1 2020-06-27 15:52:01 +02:00
cytopia
0669d92289 Adjust travis.yml 2020-06-27 12:16:48 +02:00
cytopia
6d2053878a Fix broken pipelines 2020-06-26 10:00:26 +02:00
cytopia
c3f46d3706 Fix push to Dockerhub 2020-04-07 12:01:29 +02:00
cytopia
de9642c2b5 Merge pull request #157 from devilbox/release-0.106
Release 0.106
2020-03-18 13:58:09 +01:00
cytopia
6fa341748b Disable PHP-FPM 8.0 uploadprogress module due to startup warnings 2020-03-18 10:03:45 +01:00
cytopia
5f719f60ce Fix build of PHP-FPM 8.0 uploadprogress module 2020-03-18 07:35:45 +01:00
cytopia
ffc8df1906 Fix build of PHP-FPM 7.4 snmp module 2020-03-18 07:13:11 +01:00
cytopia
186bf71519 Merge pull request #153 from anatolinicolae/master
Add sorting for startup files
2020-03-18 06:57:32 +01:00
cytopia
422e559ee3 Merge branch 'master' into master 2020-02-08 18:45:22 +01:00
cytopia
eb85e3e288 Merge pull request #155 from devilbox/release-0.105
Release 0.105
2020-02-06 07:55:17 +01:00
cytopia
5ed5dd2503 Use COMPOSER_MEMORY_LIMIT env var 2020-02-05 17:52:18 +01:00
cytopia
1225d564a7 Fix sqlsrv install for PHP 7.1 2020-02-04 19:13:13 +01:00
cytopia
a4102e3d7f Update changelog 2020-02-04 18:13:36 +01:00
cytopia
982dd44701 Add phalcon binary to PHP 7.3 and 7.4 2020-02-04 18:13:22 +01:00
cytopia
bc851cca0f Fix build of pdo_sqlsrv for PHP 7.1 2020-02-04 17:36:03 +01:00
cytopia
ef5b2ed58c Fix composer install 2020-02-04 17:33:21 +01:00
Anatoli Nicolae
cbd4f58876 Add sorting for startup files
Alphanumerically sort files found in /startup.1.d and /startup.2.d directories, to prevent non regular script execution.

Signed-off-by: Anatoli Nicolae <desk@anatolinicolae.com>
2020-01-29 15:09:56 +01:00
cytopia
fd6550627d Merge pull request #152 from devilbox/release-0.104
Release 0.104
2020-01-17 12:16:32 +01:00
cytopia
af150ba371 Fix xdebug install for PHP 7.0 2020-01-17 09:38:48 +01:00
cytopia
47800a7ede Merge pull request #151 from devilbox/release-0.103
Release v0.103
2020-01-14 20:32:06 +01:00
cytopia
d977d941ac Add PHP yaml module 2020-01-14 17:39:37 +01:00
cytopia
2ae551e5a5 Merge pull request #150 from devilbox/UPDATE-README
Update available tools
2020-01-09 13:12:14 +01:00
cytopia
37747d392a Update available tools 2020-01-09 13:13:53 +01:00
cytopia
0a5aadd2a2 Merge pull request #149 from devilbox/release-0.102
Release 0.102
2020-01-09 13:10:07 +01:00
cytopia
64c41f7786 Replace scss-lint with stylelint 2020-01-08 15:44:08 +01:00
cytopia
8bef4c7167 Fixes #144 Adding CHANGELOG 2020-01-08 13:31:56 +01:00
cytopia
58ecd35153 Fixes #123 Replace Ruby Sass with Dart Sass 2020-01-08 13:30:08 +01:00
cytopia
55a1333d58 Merge pull request #147 from devilbox/release-0.101
Release v0.101
2020-01-05 15:20:39 +01:00
cytopia
fa1ec623d7 Change symfony cli from i686 to amd64 2020-01-05 13:37:53 +01:00
cytopia
faa10b9512 Consolidate curl commands 2020-01-05 13:31:35 +01:00
cytopia
fc6df6bdaf Use latest Symfony version 2020-01-05 13:28:48 +01:00
cytopia
649f667f45 Merge pull request #146 from devilbox/release-0.100
Release v0.100
2020-01-04 22:30:02 +01:00
cytopia
0cbd58141d Fix wget download 2020-01-04 21:22:39 +01:00
cytopia
965db7f0d5 Allow chown homedir to fail (e.g.: for read-only sub-mount) 2020-01-04 21:03:29 +01:00
cytopia
172baf9743 Merge pull request #145 from devilbox/release-0.99
Add phpmd binary
2020-01-04 20:51:41 +01:00
cytopia
fc5e5e21e5 Ensure unwanted artifacts are removed during build 2020-01-04 20:52:31 +01:00
cytopia
529a33f1a0 Fix phpredis for PHP 8.0 2020-01-04 19:18:35 +01:00
cytopia
cc77461311 Fix missing backslash in Docker command 2020-01-04 18:35:29 +01:00
cytopia
f04a5ec693 Fix phpredis module for PHP 7.4 and 8.0 2020-01-04 18:32:01 +01:00
cytopia
90495fab70 Add phpmd binary 2020-01-04 18:17:09 +01:00
cytopia
f8f485b0bb Merge pull request #143 from devilbox/release-0.98
Release v0.98
2019-12-31 19:06:26 +01:00
cytopia
3ad0330bca Add -o option to mhsendmail 2019-12-31 16:30:59 +01:00
cytopia
2587886b24 Fixes #105 Allow to start postfix without Email catch-all 2019-12-31 15:47:36 +01:00
cytopia
3ce6ed507b Merge pull request #142 from devilbox/release-0.97
Use official PHP 7.4 image
2019-12-28 19:38:39 +01:00
cytopia
f05301572d Add solr and ssh2 PHP modules 2019-12-28 17:39:12 +01:00
cytopia
40d76f355f Use official PHP 7.4 image 2019-12-28 15:59:15 +01:00
cytopia
9c1e49b814 Merge pull request #141 from devilbox/release-0.96
Release v0.96
2019-12-28 03:00:34 +01:00
cytopia
c1aa814206 Update modules in README 2019-12-27 17:22:19 +01:00
cytopia
a382745a2f Fix phalcon-devtools install 2019-12-27 17:19:45 +01:00
cytopia
d9d6f2d157 Fix deployer install 2019-12-27 14:56:47 +01:00
cytopia
9c82fb08c3 Fix Phalcon PHP module 2019-12-27 14:40:37 +01:00
cytopia
91733db9e9 Fix npm install 2019-12-27 13:30:55 +01:00
cytopia
41fec62672 Fix pecl install 2019-12-27 11:43:23 +01:00
cytopia
3e9e00e0c2 Merge pull request #136 from devilbox/release-0.95
Release 0.95
2019-11-29 09:36:04 +01:00
cytopia
d4a16ba3b3 Fix laravel cli 2019-11-28 11:49:50 +01:00
cytopia
fb7a3e8bff Merge pull request #135 from devilbox/release-0.94
Release 0.94
2019-11-22 00:05:32 +01:00
cytopia
dc7336fa3d Show tests that are skipped 2019-11-21 22:01:15 +01:00
cytopia
0750ec9339 imagick integration tests 2019-11-21 17:22:36 +01:00
cytopia
c360bec703 Update phalcon module 2019-11-21 17:22:22 +01:00
cytopia
1ec8a494e4 Add enchant to 7.3 2019-11-21 16:05:03 +01:00
cytopia
883a897420 Add enchant to 7.4 and 8.0 2019-11-21 15:56:49 +01:00
cytopia
7f018000be Merge pull request #134 from devilbox/release-0.93
Release 0.93
2019-11-19 09:19:08 +01:00
cytopia
7f3a6f3e64 Disable imagick for 5.3, 5.4 and 5.5 due to segfaults 2019-11-18 23:48:06 +01:00
cytopia
83124e8632 Add more gd tests 2019-11-18 17:58:00 +01:00
cytopia
806b408878 Only check imagick against supported versions 2019-11-18 17:44:11 +01:00
cytopia
3d15aea68b Fix gd for PHP 7.4 and PHP 8.0 2019-11-18 16:52:55 +01:00
cytopia
db7c4e6334 Add module integration tests 2019-11-18 16:52:35 +01:00
cytopia
2c6e013fad Adding Ghostscript 2019-11-17 22:48:50 +01:00
cytopia
b35f3a822c Merge pull request #132 from fschndr/master
Fixed typo in MySQL backup example
2019-11-16 13:23:32 +01:00
Fabian
f20932ce74 Fixed typo in MySQL backup example
The container-side path of the volume had a typo in the README.md example.
2019-11-13 10:51:52 +01:00
cytopia
78d39e57f0 Merge pull request #131 from devilbox/release-0.92
Release 0.92
2019-11-09 17:07:32 +01:00
cytopia
6b666d029b Enable more extensions 2019-11-09 14:45:11 +01:00
cytopia
85b743c822 Enable xdebug for PHP 7.4 2019-11-09 11:46:42 +01:00
cytopia
2643b28775 Refs #121 Allow to overwrite CMD and have custom startup commands 2019-11-09 00:17:31 +01:00
cytopia
bbe1b43474 Prepare Nightly builds 2019-11-08 20:32:31 +01:00
cytopia
83f57430e5 Merge pull request #130 from devilbox/github-actions
Prepare push phase
2019-11-08 19:29:33 +01:00
cytopia
696faf598d Prepare push phase 2019-11-08 09:42:06 +01:00
cytopia
a0a0738205 Merge pull request #129 from devilbox/github-actions-fix
Fix variable replacement in GitHub actions
2019-11-06 15:50:16 +01:00
cytopia
020d778fca Fix variable replacement in GitHub actions 2019-11-06 15:51:20 +01:00
cytopia
cd7424d1f6 Merge pull request #128 from devilbox/release-0.91
Release 0.91
2019-11-06 14:48:29 +01:00
cytopia
5ef91da97f CI: Prepare push conditions 2019-11-06 09:43:11 +01:00
cytopia
f59dd5bf6c Merge pull request #127 from devilbox/release-0.90
Release 0.90
2019-11-04 18:31:27 +01:00
cytopia
bc01b396a1 Shorten build time on Travis to be within limits 2019-11-04 10:24:26 +01:00
cytopia
dd78ed0b71 Update README.md 2019-11-04 03:18:25 +01:00
cytopia
ec7e1cb622 Speed up Dockerfile generation 2019-11-04 01:09:10 +01:00
cytopia
91741aaf7f Fix phalcon install 2019-11-04 00:53:24 +01:00
cytopia
87234a6f46 Simplify GitHub Action workflow 2019-11-04 00:53:06 +01:00
cytopia
a6236b19c7 Fix work images 2019-11-03 22:48:51 +01:00
cytopia
67017e494e Make RUN commands more strict 2019-11-03 18:20:23 +01:00
cytopia
31864f8335 Fix mod images 2019-11-03 17:42:41 +01:00
cytopia
7585081644 Move builds to GitHub Actions 2019-11-02 21:00:27 +01:00
cytopia
3e8b4856d1 Dockerize generate command to remove local dependencies 2019-11-02 14:37:45 +01:00
cytopia
46d1c48104 Update yamllint 2019-11-02 14:37:21 +01:00
cytopia
47d2d1f9f5 Merge pull request #120 from devilbox/release-0.89
Release 0.89
2019-06-10 11:50:41 +02:00
cytopia
019c3b82d8 Disable DrupalConsole for PHP 8.0 2019-06-09 14:30:54 +02:00
cytopia
1817f84301 FFI is now already available in PHP 8.0 base image 2019-06-09 09:15:12 +02:00
cytopia
3fd1652455 Disable Phalcon for PHP 7.3 as it currently core-dumps 2019-06-09 09:13:48 +02:00
cytopia
e75b7cb54c Merge pull request #117 from devilbox/release-0.88
Feature update
2019-05-20 18:08:05 +02:00
cytopia
d68b8dcff0 Fix OAuth module name in README 2019-05-20 09:53:07 +02:00
cytopia
5bd9466995 Add nvm path to default bash config 2019-05-20 09:50:54 +02:00
cytopia
2b53dcab7a Add tool: yq 2019-05-20 09:17:20 +02:00
cytopia
d286467a6f Disable enchant php module for php 7.4 and 8.0 2019-05-20 09:14:44 +02:00
cytopia
d87857e598 Add oauth module 2019-05-20 09:13:54 +02:00
cytopia
a9c8d4fbbe Add composer prestissimo 2019-05-19 10:09:53 +02:00
cytopia
be4492795b Add zlib1g-dev library 2019-05-19 08:49:04 +02:00
cytopia
5a10077fe2 Allow symlinks for autostart scripts 2019-05-19 08:42:07 +02:00
cytopia
3075f2afca Merge pull request #115 from devilbox/release-0.87
Fix scss_lint install
2019-05-12 15:08:00 +02:00
cytopia
36355c3d60 Disable Interbase for PHP 7.4 and 8.0 2019-05-12 13:18:36 +02:00
cytopia
80f8557962 Fix scss_lint install 2019-05-11 16:41:39 +02:00
cytopia
3883103a41 Merge pull request #113 from devilbox/release-0.86
Re-enable uploadprogress for PHP 8.0
2019-04-23 20:37:32 +02:00
cytopia
687a660baa Re-enable uploadprogress for PHP 8.0 2019-04-23 13:30:31 +02:00
cytopia
6f8f5cc1ea Merge pull request #112 from devilbox/release-0.85
Fix MongoDB module for PHP 8.0
2019-04-23 08:35:40 +02:00
cytopia
f602092471 Fix MongoDB module for PHP 8.0 2019-04-22 14:14:57 +02:00
cytopia
bcbc8e2e45 Merge pull request #111 from devilbox/release-0.84
Release 0.84
2019-04-20 09:47:54 +02:00
cytopia
4b21c70b8f Fix RDKAFKA module 2019-04-19 12:17:58 +02:00
cytopia
b943b30b01 Add tool: Angular CLI 2019-04-19 12:03:57 +02:00
cytopia
2df2b8c7eb Add tool: Laravel Lumen cli 2019-04-19 12:03:08 +02:00
cytopia
2ab9995e99 Merge pull request #110 from devilbox/release-0.83
Fix module installations
2019-04-19 10:01:03 +02:00
cytopia
1e9cb5bcb9 Fix git checkout 2019-04-17 16:11:45 +02:00
cytopia
bdb61b9c00 Fix module installations 2019-04-17 09:30:57 +02:00
cytopia
47e221e210 Merge pull request #108 from devilbox/release-0.82
Fix apt repositories for Debian Jessie
2019-04-09 19:24:14 +02:00
cytopia
173fd463d3 Fix enabled modules for PHP 8.0 to ensure build success 2019-04-09 15:58:01 +02:00
cytopia
e4dd462ef2 Fix apt repositories for Debian Jessie 2019-04-09 12:01:26 +02:00
cytopia
4b40a0d932 Merge pull request #107 from devilbox/release-0.81
Release 0.81
2019-03-23 20:32:27 +01:00
cytopia
1126319f3d Deprecated wddx extension: https://wiki.php.net/rfc/deprecate-and-remove-ext-wddx 2019-03-23 17:53:53 +01:00
cytopia
56a5cfeb5e Update MongoDB and PostgreSQL repositories 2019-03-23 15:50:55 +01:00
cytopia
391502b9eb Fix password substitution in mysqldump-secure configuration 2019-03-23 14:19:55 +01:00
cytopia
b1c8c8b107 Add tool: Vue CLI 2019-03-23 14:01:55 +01:00
cytopia
81bdfb1026 Make installation of Oracle Instantclient version independent 2019-03-23 13:26:59 +01:00
cytopia
f69a96e16f Merge pull request #104 from devilbox/release-0.80
Rewrite gem, npm and pip install management
2019-03-08 19:36:59 +01:00
cytopia
e3ddad4e50 Revert wget usage of --hsts-file=/dev/null 2019-03-08 15:14:14 +01:00
cytopia
dfc3481773 Rewrite gem, npm and pip install management 2019-03-08 14:21:03 +01:00
687 changed files with 59239 additions and 14945 deletions

View File

@@ -0,0 +1,62 @@
; ############################################################
; # Devilbox PHP defaults for {{ php_version }}-{{ item.key }}
; ############################################################
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
; If none is present, the one from the previous flavour is inherited.
[PHP]
; Memory
; Note: "memory_limit" should be larger than "post_max_size"
memory_limit = {{ item.cfg[item.key].memory_limit | default(item.cfg[item.alt].memory_limit) }}
; Timeouts
max_execution_time = {{ item.cfg[item.key].max_execution_time | default(item.cfg[item.alt].max_execution_time) }}
max_input_time = {{ item.cfg[item.key].max_input_time | default(item.cfg[item.alt].max_input_time) }}
; Uploads
; Note: "post_max_size" should be greater than "upload_max_filesize"
post_max_size = {{ item.cfg[item.key].post_max_size | default(item.cfg[item.alt].post_max_size) }}
upload_max_filesize = {{ item.cfg[item.key].upload_max_filesize | default(item.cfg[item.alt].upload_max_filesize) }}
max_file_uploads = {{ item.cfg[item.key].max_file_uploads | default(item.cfg[item.alt].max_file_uploads) }}
; Vars
variables_order = {{ item.cfg[item.key].variables_order | default(item.cfg[item.alt].variables_order) }}
{# Only available since PHP >=5.4 #}
{% if not (php_version == 5.2 or php_version == 5.3 ) %}
max_input_vars = {{ item.cfg[item.key].max_input_vars | default(item.cfg[item.alt].max_input_vars) }}
{% endif %}
max_input_nesting_level = {{ item.cfg[item.key].max_input_nesting_level | default(item.cfg[item.alt].max_input_nesting_level) }}
; Error reporting
; Note: error_log is dynamic and handled during start to set appropriate setting
error_reporting = {{ item.cfg[item.key].error_reporting | default(item.cfg[item.alt].error_reporting) }}
xmlrpc_errors = {{ item.cfg[item.key].xmlrpc_errors | default(item.cfg[item.alt].xmlrpc_errors) }}
report_memleaks = {{ item.cfg[item.key].report_memleaks | default(item.cfg[item.alt].report_memleaks) }}
display_errors = {{ item.cfg[item.key].display_errors | default(item.cfg[item.alt].display_errors) }}
display_startup_errors = {{ item.cfg[item.key].display_startup_errors | default(item.cfg[item.alt].display_startup_errors) }}
{# Only available before PHP 7.2 #}
{% if php_version == 5.2 or php_version == 5.3 or php_version == 5.4 or php_version == 5.5 or php_version == 5.6 or php_version == 7.0 or php_version == 7.1 %}
track_errors = {{ item.cfg[item.key].track_errors | default(item.cfg[item.alt].track_errors) }}
{% endif %}
log_errors = {{ item.cfg[item.key].log_errors | default(item.cfg[item.alt].log_errors) }}
html_errors = {{ item.cfg[item.key].html_errors | default(item.cfg[item.alt].html_errors) }}
; Xdebug settings
{% if php_version == 5.2 or php_version == 5.3 or php_version == 5.4 or php_version == 5.5 or php_version == 5.6 or php_version == 7.0 or php_version == 7.1 %}
xdebug.default_enable = {{ item.cfg[item.key].xdebug2_default_enable | default(item.cfg[item.alt].xdebug2_default_enable) }}
xdebug.profiler_enable = {{ item.cfg[item.key].xdebug2_profiler_enable | default(item.cfg[item.alt].xdebug2_profiler_enable) }}
xdebug.remote_enable = {{ item.cfg[item.key].xdebug2_remote_enable | default(item.cfg[item.alt].xdebug2_remote_enable) }}
xdebug.remote_autostart = {{ item.cfg[item.key].xdebug2_remote_autostart | default(item.cfg[item.alt].xdebug2_remote_autostart) }}
{% else %}
xdebug.mode = {{ item.cfg[item.key].xdebug3_mode | default(item.cfg[item.alt].xdebug3_mode) }}
xdebug.start_with_request = {{ item.cfg[item.key].xdebug3_start_with_request | default(item.cfg[item.alt].xdebug3_start_with_request) }}
xdebug.client_port = {{ item.cfg[item.key].xdebug3_client_port | default(item.cfg[item.alt].xdebug3_client_port) }}
{% endif %}

View File

@@ -1,12 +1,19 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
{{ edit_comment_base }}
{% if php_version == 5.2 %} {% if php_version == 5.2 %}
FROM devilbox/php-fpm-5.2 FROM devilbox/php-fpm-5.2
{% elif php_version == 5.3 %} {% elif php_version == 5.3 %}
FROM devilbox/php-fpm-5.3 FROM devilbox/php-fpm-5.3
{% elif php_version == 7.4 %} {% elif php_version == 5.4 %}
FROM devilbox/php-fpm-7.4 FROM devilbox/php-fpm-5.4
{% elif php_version == 5.5 %}
FROM devilbox/php-fpm-5.5
{% elif php_version == 8.0 %} {% elif php_version == 8.0 %}
FROM devilbox/php-fpm-8.0 FROM devilbox/php-fpm-8.0
{% elif php_version == 8.1 %}
FROM devilbox/php-fpm-8.1
{% elif php_version == 8.2 %}
FROM devilbox/php-fpm-8.2
{% else %} {% else %}
FROM php:{{ php_version }}-fpm FROM php:{{ php_version }}-fpm
{% endif %} {% endif %}
@@ -16,12 +23,20 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM {{ php_version }} Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="{{ php_version }}-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="{{ php_version }}-base"
LABEL "org.opencontainers.image.title"="PHP-FPM {{ php_version }}-base"
LABEL "org.opencontainers.image.description"="PHP-FPM {{ php_version }}-base"
### ###
@@ -37,7 +52,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -45,16 +60,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -77,7 +94,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^{{ php_version }}' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^{{ php_version }}' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -104,4 +121,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,476 @@
# vi: ft=dockerfile
{{ edit_comment_mods }}
FROM devilbox/php-fpm:{{ php_version }}-base as builder
{#
###################################################################################################
Loop over enabled build dependencies and gather build dependencies
###################################################################################################
#}
{%- set build_deps = [] -%}
{%- for ext in extensions_enabled -%}
{#- Not disabled AND not already available by default -#}
{%- if (('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled']))
and ('already_avail' not in extensions_available[ext] or php_version not in extensions_available[ext]['already_avail']) -%}
{#- Version specific build dependency available? -#}
{%- if php_version in extensions_available[ext] and 'build_dep' in extensions_available[ext][php_version] -%}
{%- for build_dep in extensions_available[ext][php_version]['build_dep'] -%}
{#- Append build dependencies to our array -#}
{{- build_deps.append(build_dep) -}}
{%- endfor -%}
{#- Generic build dependency available? -#}
{%- elif 'all' in extensions_available[ext] and 'build_dep' in extensions_available[ext]['all'] -%}
{%- for build_dep in extensions_available[ext]['all']['build_dep'] -%}
{#- Append build dependencies to our array -#}
{{- build_deps.append(build_dep) -}}
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
###
### Install
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
{% for build_dep in build_deps | unique | sort %}
{{ build_dep }} \
{% endfor %}
# Build tools
autoconf \
bison \
bisonc++ \
ca-certificates \
curl \
dpkg-dev \
file \
flex \
g++ \
gcc \
git \
lemon \
libc-client-dev \
libc-dev \
libcurl4-openssl-dev \
libssl-dev \
make \
patch \
pkg-config \
re2c \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
# Fix timezone (only required for testing to stop php -v and php-fpm -v from complaining to stderr)
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini
###
### Install and enable PHP modules
###
# Enable ffi if it exists
RUN set -eux \
&& if [ -f /usr/local/etc/php/conf.d/docker-php-ext-ffi.ini ]; then \
echo "ffi.enable = 1" >> /usr/local/etc/php/conf.d/docker-php-ext-ffi.ini; \
fi
{# Loop over enabled extensions #}
{% for ext in extensions_enabled %}
{#-
###############################################################################################
# Not disabled AND not already enabled
###############################################################################################
-#}
{%- if (('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled'])) and ('already_avail' not in extensions_available[ext] or php_version not in extensions_available[ext]['already_avail']) %}
# -------------------- Installing PHP Extension: {{ ext }} --------------------
RUN set -eux \
{#-
# --------------------------------------------------------------------------------
# PRE COMMAND
# --------------------------------------------------------------------------------
-#}
{#- Version specific pre-command available? -#}
{%- if php_version in extensions_available[ext] and 'pre' in extensions_available[ext][php_version] -%}
{{- "\n\t" }}# Version specific pre-command
{{- "\n\t" }}&& {{ extensions_available[ext][php_version]['pre'] }} \
{#- Generic pre-command available? -#}
{%- elif 'all' in extensions_available[ext] and 'pre' in extensions_available[ext]['all'] %}
{{- "\n\t" }}# Generic pre-command
{{- "\n\t" }}&& {{ extensions_available[ext]['all']['pre'] }} \
{%- endif -%}
{#-
# --------------------------------------------------------------------------------
# INSTALLATION (VERSION SPECIFIC)
# --------------------------------------------------------------------------------
#}
{%- if php_version in extensions_available[ext] and 'type' in extensions_available[ext][php_version] -%}
{{- "\n\t" }}# Installation: Version specific
{#-
# -------------------- 1.) Builtin --------------------
-#}
{%- if extensions_available[ext][php_version]['type'] == 'builtin' -%}
{{- "\n\t" }}# Type: Built-in extension
{%- if 'configure' in extensions_available[ext][php_version] -%}
{{- "\n\t" }}# Custom: configure command
{{- "\n\t" }}&& docker-php-ext-configure {{ ext }} {{ extensions_available[ext][php_version]['configure'] }} \
{%- elif 'configure' in extensions_available[ext]['all'] -%}
{{- "\n\t" }}# Default: configure command
{{- "\n\t" }}&& docker-php-ext-configure {{ ext }} {{ extensions_available[ext]['all']['configure'] }} \
{%- endif -%}
{{- "\n\t" }}# Installation
{{- "\n\t" }}&& docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) {{ ext }} \
{#-
# -------------------- 2.) PECL --------------------
-#}
{%- elif extensions_available[ext][php_version]['type'] == 'pecl' -%}
{{- "\n\t" }}# Type: PECL extension
{%- if 'command' in extensions_available[ext][php_version] -%}
{{- "\n\t" }}# Custom: Pecl command
{{- "\n\t" }}&& {{ extensions_available[ext][php_version]['command'] }} \
{%- else -%}
{{- "\n\t" }}# Default: Pecl command
{{- "\n\t" }}&& pecl install {{ ext }}{% if 'version' in extensions_available[ext][php_version] %}-{{ extensions_available[ext][php_version]['version'] }}{% endif %} \
{%- endif -%}
{{- "\n\t" }}# Enabling
{{- "\n\t" }}&& docker-php-ext-enable {{ ext }} \
{#-
# -------------------- 3.) GIT --------------------
-#}
{%- elif extensions_available[ext][php_version]['type'] == 'git' -%}
{{- "\n\t" }}# Type: GIT extension
{{- "\n\t" }}&& git clone {{ extensions_available[ext][php_version]['git_url'] }} /tmp/{{ ext }} \
{{- "\n\t" }}&& cd /tmp/{{ ext }} \
{%- if 'git_ref' in extensions_available[ext][php_version] -%}
{{- "\n\t" }}# Custom: Branch
{{- "\n\t" }}&& git checkout {{ extensions_available[ext][php_version]['git_ref'] }} \
{%- endif -%}
{%- if 'command' in extensions_available[ext][php_version] -%}
{{- "\n\t" }}# Custom: Install command
{{- "\n\t" }}&& {{ extensions_available[ext][php_version]['command'] }} \
{%- else -%}
{{- "\n\t" }}# Default: Install command
{{- "\n\t" }}&& phpize \
{{- "\n\t" }}&& ./configure {% if 'configure' in extensions_available[ext][php_version] %} {{ extensions_available[ext][php_version]['configure'] }}{% endif %} \
{{- "\n\t" }}&& make -j$(getconf _NPROCESSORS_ONLN) \
{{- "\n\t" }}&& make install \
{%- endif -%}
{{- "\n\t" }}# Enabling
{{- "\n\t" }}&& docker-php-ext-enable {{ ext }} \
{#-
# -------------------- 4.) CUSTOM --------------------
-#}
{%- elif extensions_available[ext][php_version]['type'] == 'custom' -%}
{{- "\n\t" }}# Type: Custom extension
{{- "\n\t" }}&& {{ extensions_available[ext][php_version]['command'] }} \
{%- endif -%}
{#-
# --------------------------------------------------------------------------------
# INSTALLATION (GENERIC)
# --------------------------------------------------------------------------------
#}
{%- elif 'all' in extensions_available[ext] and 'type' in extensions_available[ext]['all'] -%}
{{- "\n\t" }}# Installation: Generic
{#-
# -------------------- 1.) Builtin --------------------
-#}
{%- if extensions_available[ext]['all']['type'] == 'builtin' -%}
{{- "\n\t" }}# Type: Built-in extension
{%- if 'configure' in extensions_available[ext]['all'] -%}
{{- "\n\t" }}# Custom: configure command
{{- "\n\t" }}&& docker-php-ext-configure {{ ext }} {{ extensions_available[ext]['all']['configure'] }} \
{%- endif -%}
{{- "\n\t" }}&& docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) {{ ext }} \
{#-
# -------------------- 2.) PECL --------------------
-#}
{%- elif extensions_available[ext]['all']['type'] == 'pecl' -%}
{{- "\n\t" }}# Type: PECL extension
{%- if 'command' in extensions_available[ext]['all'] -%}
{{- "\n\t" }}# Custom: Pecl command
{{- "\n\t" }}&& {{ extensions_available[ext]['all']['command'] }} \
{%- else -%}
{{- "\n\t" }}# Default: Pecl command
{{- "\n\t" }}&& pecl install {{ ext }}{% if 'version' in extensions_available[ext]['all'] %}-{{ extensions_available[ext]['all']['version'] }}{% endif %} \
{%- endif -%}
{{- "\n\t" }}# Enabling
{{- "\n\t" }}&& docker-php-ext-enable {{ ext }} \
{#-
# -------------------- 2.) GIT --------------------
-#}
{%- elif extensions_available[ext]['all']['type'] == 'git' -%}
{{- "\n\t" }}# Type: GIT extension
{{- "\n\t" }}&& git clone {{ extensions_available[ext]['all']['git_url'] }} /tmp/{{ ext }} \
{{- "\n\t" }}&& cd /tmp/{{ ext }} \
{%- if 'git_ref' in extensions_available[ext]['all'] -%}
{{- "\n\t" }}# Custom: Branch
{{- "\n\t" }}&& git checkout {{ extensions_available[ext]['all']['git_ref'] }} \
{%- endif -%}
{%- if 'command' in extensions_available[ext]['all'] -%}
{{- "\n\t" }}# Custom: Install command
{{- "\n\t" }}&& {{ extensions_available[ext]['all']['command'] }} \
{%- else -%}
{{- "\n\t" }}# Default: Install command
{{- "\n\t" }}&& phpize \
{{- "\n\t" }}&& ./configure {% if 'configure' in extensions_available[ext]['all'] %} {{ extensions_available[ext]['all']['configure'] }}{% endif %} \
{{- "\n\t" }}&& make -j$(getconf _NPROCESSORS_ONLN) \
{{- "\n\t" }}&& make install \
{%- endif -%}
{{- "\n\t" }}# Enabling
{{- "\n\t" }}&& docker-php-ext-enable {{ ext }} \
{#-
# -------------------- 4.) CUSTOM --------------------
-#}
{%- elif extensions_available[ext]['all']['type'] == 'custom' -%}
{{- "\n\t" }}# Type: Custom extension
{{- "\n\t" }}&& {{ extensions_available[ext]['all']['command'] }} \
{%- endif -%}
{%- endif -%}
{#-
# --------------------------------------------------------------------------------
# POST COMMAND
# --------------------------------------------------------------------------------
-#}
{#- Version specific post-command available? -#}
{%- if php_version in extensions_available[ext] and 'post' in extensions_available[ext][php_version] -%}
{{- "\n\t" }}# Version specific post-command
{{- "\n\t" }}&& {{ extensions_available[ext][php_version]['post'] }} \
{#- Generic post-command available? -#}
{%- elif 'all' in extensions_available[ext] and 'post' in extensions_available[ext]['all'] %}
{{- "\n\t" }}# Generic post-command
{{- "\n\t" }}&& {{ extensions_available[ext]['all']['post'] }} \
{%- endif -%}
{#- End of: Not disabled AND not already enabled -#}
{%- endif -%}
{#-
###############################################################################################
# Ensure modules that are not disabled have an appropriate ini directive and are loaded
###############################################################################################
-#}
{%- if ('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled']) -%}
{%- if php_version in extensions_available[ext] and 'load_ext' in extensions_available[ext][php_version] -%}
{{- "\n\t" }}# Activate: Version specific extension
{{- "\n\t" }}&& if [ ! -f "/usr/local/etc/php/conf.d/docker-php-ext-{{ ext }}.ini" ]; then \
{{- "\n\t" }} echo "extension={{ extensions_available[ext][php_version]['load_ext'] }}" > "/usr/local/etc/php/conf.d/docker-php-ext-{{ ext }}.ini"; \
{{- "\n\t" }}fi \
{%- elif 'all' in extensions_available[ext] and 'load_ext' in extensions_available[ext]['all'] -%}
{{- "\n\t" }}# Activate: Generic extension
{{- "\n\t" }}&& if [ ! -f "/usr/local/etc/php/conf.d/docker-php-ext-{{ ext }}.ini" ]; then \
{{- "\n\t" }} echo "extenstion={{ extensions_available[ext]['all']['load_ext'] }}" > "/usr/local/etc/php/conf.d/docker-php-ext-{{ ext }}.ini"; \
{{- "\n\t" }}fi \
{%- endif -%}
{%- endif %}
{#-
###############################################################################################
# Test extensions
###############################################################################################
-#}
{#- Not disabled #}
{%- if (('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled'])) and ('already_avail' not in extensions_available[ext] or php_version not in extensions_available[ext]['already_avail']) %}
{%- if build_fail_fast -%}
{{- "\n\t" }}# ---- Test extension ----
{{- "\n\t" }}&& /usr/local/sbin/php-fpm --test \
{{- "\n\t" }}\
{{- "\n\t" }}&& (php -v 2>&1 1>/dev/null || true) \
{{- "\n\t" }}&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
{{- "\n\t" }}&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
{{- "\n\t" }}&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
{{- "\n\t" }}&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
{{- "\n\t" }}\
{{- "\n\t" }}&& (php-fpm -v 2>&1 1>/dev/null || true) \
{{- "\n\t" }}&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
{{- "\n\t" }}&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
{{- "\n\t" }}&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
{{- "\n\t" }}&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
{{- "\n\t" }}\
{%- if ext == 'opcache' -%}
{{- "\n\t" }}&& php -m | grep -oiE '^Zend Opcache$' \
{{- "\n\t" }}&& php-fpm -m | grep -oiE '^Zend Opcache$'
{%- elif ext == 'readline' -%}
{{- "\n\t" }}&& php -m | grep -oiE '^readline$'
{%- elif ext not in ['blackfire', 'ioncube'] -%}
{{- "\n\t" }}&& php -m | grep -oiE '^{{ ext }}$' \
{{- "\n\t" }}&& php-fpm -m | grep -oiE '^{{ ext }}$'
{%- else %}
{{- "\n\t" }}&& true
{%- endif %}
{{- "\n\n\n" }}
{%- else -%}
{{- "\n\t" }}&& true{{ "\n\n\n" }}
{%- endif %}
{%- endif %}
{%- endfor %}
# Fix php.ini settings for enabled extensions
RUN set -eux \
&& find "$(php -r 'echo ini_get("extension_dir");')/" -type f -exec chmod +x {} \;
# Fix oracle dir for images that don't have oci installed
RUN set -eux \
&& mkdir -p /usr/lib/oracle/
# Shrink everything down
RUN set -eux \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
{{ edit_comment_mods }}
FROM devilbox/php-fpm:{{ php_version }}-base as final
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="{{ php_version }}-mods"
LABEL "org.opencontainers.image.title"="PHP-FPM {{ php_version }}-mods"
LABEL "org.opencontainers.image.description"="PHP-FPM {{ php_version }}-mods"
###
### Install runtime libraries
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
{# Loop over enabled run-time dependencies -#}
{%- set run_deps = [] -%}
{%- for ext in extensions_enabled -%}
{#- Not disabled -#}
{%- if ('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled']) -%}
{#- Version specific run-time dependency available? -#}
{%- if php_version in extensions_available[ext] and 'run_dep' in extensions_available[ext][php_version] -%}
{%- for run_dep in extensions_available[ext][php_version]['run_dep'] -%}
{#- Append run dependencies to our array -#}
{{- run_deps.append(run_dep) -}}
{%- endfor -%}
{#- Generic run-time dependency available? -#}
{%- elif 'all' in extensions_available[ext] and 'run_dep' in extensions_available[ext]['all'] -%}
{%- for run_dep in extensions_available[ext]['all']['run_dep'] -%}
{#- Append run dependencies to our array -#}
{{- run_deps.append(run_dep) -}}
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{% for run_dep in run_deps | unique | sort %}
{{ run_dep }} \
{% endfor %}
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
\
&& update-ca-certificates
###
### Copy artifacts from builder
###
ARG EXT_DIR
COPY --from=builder ${EXT_DIR}/ ${EXT_DIR}/
COPY --from=builder /usr/local/etc/php/conf.d/ /usr/local/etc/php/conf.d/
COPY --from=builder /usr/local/bin/ /usr/local/bin/
COPY --from=builder /usr/local/lib/ /usr/local/lib/
COPY --from=builder /usr/lib/oracle/ /usr/lib/oracle/
###
### Post Install executions
###
{# Loop over enabled extensions #}
{%- set post_commands = {} -%}
{% for ext in extensions_enabled %}
{%- if (('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled'])) and ('already_avail' not in extensions_available[ext] or php_version not in extensions_available[ext]['already_avail']) %}
{#- Version specific post-command available? -#}
{%- if php_version in extensions_available[ext] and 'post' in extensions_available[ext][php_version] -%}
{{- post_commands.update({ext: extensions_available[ext][php_version]['post']}) -}}
{#- Generic post-command available? -#}
{%- elif 'all' in extensions_available[ext] and 'post' in extensions_available[ext]['all'] %}
{{- post_commands.update({ext: extensions_available[ext]['all']['post']}) -}}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{% if post_commands | length > 0 -%}
RUN set -eux \
{%- for ext in post_commands -%}
{{- "\n\t" }}# ---------- {{ ext }} ----------
{{- "\n\t" }}&& {{ post_commands[ext] }} \
{%- endfor -%}
{{- "\n\t" }}&& true{{- "\n\n\n" }}
{%- endif -%}
{% if debug %}
###
### Verify
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^{{ php_version }}' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini \
\
{% for ext in extensions_enabled %}
{#- Not disabled #}
{%- if ('disabled' not in extensions_available[ext]) or (php_version not in extensions_available[ext]['disabled']) %}
{%- if ext == 'opcache' %}
&& php -m | grep -oiE '^Zend Opcache$' \
&& php-fpm -m | grep -oiE '^Zend Opcache$' \
{# #}
{%- elif ext == 'readline' %}
&& php -m | grep -oiE '^readline$' \
{# #}
{%- elif ext not in ['blackfire', 'ioncube'] %}
&& php -m | grep -oiE '^{{ ext }}$' \
&& php-fpm -m | grep -oiE '^{{ ext }}$' \
{# #}
{%- endif %}
{%- endif %}
{% endfor %}
&& true
{% endif %}
# Deactive PSR and Phalcon:
# https://github.com/devilbox/docker-php-fpm/issues/201
RUN set -eux \
&& rm -f /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini || true \
&& rm -f /usr/local/etc/php/conf.d/docker-php-ext-psr.ini || true \
###
### Ports
###
EXPOSE 9000
###
### Entrypoint
###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,104 @@
# vi: ft=dockerfile
{{ edit_comment_prod }}
FROM devilbox/php-fpm:{{ php_version }}-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="{{ php_version }}-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM {{ php_version }}-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM {{ php_version }}-prod"
###
### Install
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
locales-all \
postfix \
postfix-pcre \
cron \
rsyslog \
socat \
supervisor \
&& rm -rf /var/lib/apt/lists/* \
\
# Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
\
# Setup Supervisor
&& rm -rf /etc/supervisor* \
&& mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
{% if debug %}
###
### Verify
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^{{ php_version }}' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
{% endif %}
###
### Copy files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/postfix.sh /usr/local/sbin/postfix.sh
COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf
###
### Volumes
###
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,533 @@
# vi: ft=dockerfile
{{ edit_comment_slim }}
{% import './jinja2/macros-work.j2' as fn %}
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:{{ php_version }}-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
{%- for repo in base_apt_repositories_enabled -%}
{#- Not disabled -#}
{%- if ('disabled' not in base_apt_repositories_available[repo]) or (php_version not in base_apt_repositories_available[repo]['disabled']) -%}
{#- -#}
{#- [PRE] -#}
{%- if fn.get_pre(php_version, repo, base_apt_repositories_available) | length -%}
{{ "\n\t" }}&& {{ fn.get_pre(php_version, repo, base_apt_repositories_available) | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- [KEY] -#}
{%- if fn.tool_repo_get_key(php_version, repo, base_apt_repositories_available) | length -%}
{{ "\n\t" }}&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv {{ fn.tool_repo_get_key(php_version, repo, base_apt_repositories_available) }} \
{%- endif -%}
{#- -#}
{#- [DEB] -#}
{%- if fn.tool_repo_get_deb(php_version, repo, base_apt_repositories_available) | length -%}
{{ "\n\t" }}&& echo "{{ fn.tool_repo_get_deb(php_version, repo, base_apt_repositories_available) }}" > /etc/apt/sources.list.d/{{ repo }}.list \
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{{ "\n\t" }}&& true
{% set build_deps = [] -%}
{%- for ext in base_software_enabled -%}
{%- for dep in fn.get_build_dep(php_version, ext, base_software_available) | from_json -%}
{%- if dep -%}
{{- build_deps.append(dep) -}}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
{%- if build_deps -%}
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
{% for build_dep in build_deps | unique | sort %}
{{ build_dep }} \
{% endfor %}
&& rm -rf /var/lib/apt/lists/*
{%- endif %}
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
{% if php_version in [7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2] %}
mariadb-client \
{% else %}
mysql-client \
{% endif %}
redis-tools \
sqlite3
{% set tools_apt = [] -%}
{%- for tool in base_software_enabled -%}
{%- if ('disabled' not in base_software_available[tool]) or (php_version not in base_software_available[tool]['disabled']) -%}
{%- if fn.tool_apt_get_package(php_version, tool, base_software_available) -%}
{{- tools_apt.append(fn.tool_apt_get_package(php_version, tool, base_software_available)) -}}
{%- endif -%}
{%- endif -%}
{%- endfor %}
{%- if tools_apt -%}
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
{{- "\n" -}}
{%- if tools_apt -%}
{{- "\t\t# ---------- type: apt ----------\n" -}}
{%- for apt in tools_apt | unique | sort -%}
{{- "\t\t" + apt + " \\" + "\n" -}}
{%- endfor -%}
{%- endif -%}
{{- "\t" -}}&& rm -rf /var/lib/apt/lists/*{{- "\n" -}}
{% endif %}
###
### Devilbox required cli tools from group_vars (slim.yml)
###
{% for tool in base_software_enabled -%}
{# Not disabled #}
{%- if ('disabled' not in base_software_available[tool]) or (php_version not in base_software_available[tool]['disabled']) -%}
{{- "\n" }}# -------------------- {{ tool }} --------------------
{{- "\n" }}RUN set -eux \
{#- -#}
{#- [PRE] -#}
{%- if fn.get_pre(php_version, tool, base_software_available) | length -%}
{{ "\n\t" }}&& {{ fn.get_pre(php_version, tool, base_software_available) | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- [COMMAND] -#}
{%- if fn.get_type(php_version, tool, base_software_available) == 'custom' -%}
{{ "\n\t" }}&& {{ fn.tool_custom_get_command(php_version, tool, base_software_available) | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- [POST] -#}
{%- if fn.get_post(php_version, tool, base_software_available) | length -%}
{{ "\n\t" }}&& {{ fn.get_post(php_version, tool, base_software_available) | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- [CHECK] -#}
{%- if 'check' in base_software_available[tool] -%}
{{ "\n\t" }}&& {{ base_software_available[tool]['check'] | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- Finalize -#}
{{ "\n\t" }}&& true{{ "\n" }}
{%- endif -%}
{%- endfor %}
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:{{ php_version }}-prod as devilbox-slim-base
ARG ARCH
{% set tools_apt = [] -%}
{%- for tool in base_software_enabled -%}
{%- if ('disabled' not in base_software_available[tool]) or (php_version not in base_software_available[tool]['disabled']) -%}
{%- if fn.tool_apt_get_package(php_version, tool, base_software_available) -%}
{{- tools_apt.append(fn.tool_apt_get_package(php_version, tool, base_software_available)) -}}
{%- endif -%}
{%- endif -%}
{%- endfor %}
{%- if tools_apt -%}
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
{{- "\n" -}}
{%- if tools_apt -%}
{{- "\t\t# ---------- type: apt ----------\n" -}}
{%- for apt in tools_apt | unique | sort -%}
{{- "\t\t" + apt + " \\" + "\n" -}}
{%- endfor -%}
{%- endif -%}
{{- "\t" -}}&& rm -rf /var/lib/apt/lists/*{{- "\n" -}}
{% endif %}
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-{{ php_version }}.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-{{ php_version }}.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
{% for tool in base_software_enabled -%}
{# Not disabled #}
{%- if ('disabled' not in base_software_available[tool]) or (php_version not in base_software_available[tool]['disabled']) -%}
{{- "\n" }}# -------------------- {{ tool }} --------------------
{{- "\n" }}RUN set -eux \
{#- -#}
{#- [CHECK] -#}
{%- if 'check' in base_software_available[tool] -%}
{{ "\n\t" }}&& {{ base_software_available[tool]['check'] | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- Finalize -#}
{{ "\n\t" }}&& true{{ "\n" }}
{%- endif -%}
{%- endfor %}
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^{{ php_version }}' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="{{ php_version }}-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM {{ php_version }}-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM {{ php_version }}-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,576 @@
# vi: ft=dockerfile
{{ edit_comment_work }}
{% import './jinja2/macros-work.j2' as fn %}
########################################################################################################################
########################################################################################################################
###
### Stage 1/7: Devilbox work image (HELP BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to install custom tools
###
FROM devilbox/php-fpm:{{ php_version }}-slim as devilbox-work-help-builder
{% set build_deps = [] -%}
{%- for ext in help_software_enabled -%}
{%- for dep in fn.get_build_dep(php_version, ext, help_software_available) | from_json -%}
{%- if dep -%}
{{- build_deps.append(dep) -}}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
{%- if build_deps -%}
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
{% for build_dep in build_deps | unique | sort %}
{{ build_dep }} \
{% endfor %}
&& rm -rf /var/lib/apt/lists/*
{%- endif %}
{% set run_deps = [] -%}
{%- for ext in help_software_enabled -%}
{%- for dep in fn.get_run_dep(php_version, ext, help_software_available) | from_json -%}
{%- if dep -%}
{{- run_deps.append(dep) -}}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
{%- if run_deps -%}
###
### Install run_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
{% for run_dep in run_deps | unique | sort %}
{{ run_dep }} \
{% endfor %}
&& rm -rf /var/lib/apt/lists/*
{%- endif %}
###
### Devilbox required helper tools from group_vars (work-help.yml)
###
{% for tool in help_software_enabled -%}
{# Not disabled #}
{%- if ('disabled' not in help_software_available[tool]) or (php_version not in help_software_available[tool]['disabled']) -%}
{{- "\n" }}# -------------------- {{ tool }} --------------------
{{- "\n" }}RUN set -eux \
{#- -#}
{#- [PRE] -#}
{%- if fn.get_pre(php_version, tool, help_software_available) | length -%}
{{ "\n\t" }}&& {{ fn.get_pre(php_version, tool, help_software_available) | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- [COMMAND] -#}
{%- if fn.get_type(php_version, tool, help_software_available) == 'custom' -%}
{{ "\n\t" }}&& {{ fn.tool_custom_get_command(php_version, tool, help_software_available) | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- [POST] -#}
{%- if fn.get_post(php_version, tool, help_software_available) | length -%}
{{ "\n\t" }}&& {{ fn.get_post(php_version, tool, help_software_available) | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- Finalize -#}
{{ "\n\t" }}&& true{{ "\n" }}
{%- endif -%}
{%- endfor %}
########################################################################################################################
########################################################################################################################
###
### Stage 2/7: Devilbox work image (HELP)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:{{ php_version }}-slim as devilbox-work-help
{% set run_deps = [] -%}
{%- for ext in help_software_enabled -%}
{%- for dep in fn.get_run_dep(php_version, ext, help_software_available) | from_json -%}
{%- if dep -%}
{{- run_deps.append(dep) -}}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
{%- if run_deps -%}
###
### Install run_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
{% for run_dep in run_deps | unique | sort %}
{{ run_dep }} \
{% endfor %}
&& rm -rf /var/lib/apt/lists/*
{% endif %}
###
### Copy nvm
###
COPY --from=devilbox-work-help-builder /opt/nvm /opt/nvm
###
### Copy binaries (Composer & Pip binaries)
###
COPY --from=devilbox-work-help-builder /usr/local/bin /usr/local/bin
###
### Python packages
###
COPY --from=devilbox-work-help-builder /usr/local/lib /usr/local/lib
###
### Configure Bash (composer, node yarn)
###
RUN set -eux \
&& { \
#echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo; \
echo "# [Devilbox] Ensure yarn, composer and node are in PATH"; \
echo 'PATH="${HOME}/.yarn/bin:${PATH}"'; \
echo 'PATH="${HOME}/.composer/vendor/bin:${PATH}"'; \
echo 'PATH="{{ nvm_home }}/versions/node/$(node --version)/bin:${PATH}"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Ensure to load nvm"; \
echo 'export NVM_DIR="{{ nvm_home }}"'; \
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm'; \
echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion'; \
#echo; \
#echo ". /etc/bash-devilbox"; \
#echo; \
#echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
#echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
#echo " if [ -r \"\${f}\" ]; then"; \
#echo " . \"\${f}\""; \
#echo " fi"; \
#echo " done"; \
#echo " unset f"; \
#echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/7: Devilbox work image (HELP TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-work-help as devilbox-work-help-test
###
### Devilbox required helper tools from group_vars (work-help.yml)
###
{% for tool in help_software_enabled -%}
{# Not disabled #}
{%- if ('disabled' not in help_software_available[tool]) or (php_version not in help_software_available[tool]['disabled']) -%}
{{- "\n" }}# -------------------- {{ tool }} --------------------
{{- "\n" }}RUN set -eux \
{#- -#}
{#- [CHECK] -#}
{%- if 'check' in help_software_available[tool] -%}
{{ "\n\t" }}&& {{ help_software_available[tool]['check'] | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- Finalize -#}
{{ "\n\t" }}&& true{{ "\n" }}
{%- endif -%}
{%- endfor %}
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^{{ php_version }}' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/7: Devilbox work image (TOOLS BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### This stage can be easily modified by adding tools into the ./php_tools/ directory.
###
FROM devilbox-work-help as devilbox-work-tools-builder
{% set build_deps = [] -%}
{%- set run_deps = [] -%}
{%- set tools_apt = [] -%}
{%- for tool in tools_enabled -%}
{%- for dep in fn.get_build_dep(php_version, tool, tools_available) | from_json -%}
{%- if dep -%}
{{- build_deps.append(dep) -}}
{%- endif -%}
{%- endfor -%}
{%- for dep in fn.get_run_dep(php_version, tool, tools_available) | from_json -%}
{%- if dep -%}
{{- run_deps.append(dep) -}}
{%- endif -%}
{%- endfor -%}
{%- if ('disabled' not in tools_available[tool]) or (php_version not in tools_available[tool]['disabled']) -%}
{%- if fn.tool_apt_get_package(php_version, tool, tools_available) -%}
{{- tools_apt.append(fn.tool_apt_get_package(php_version, tool, tools_available)) -}}
{%- endif -%}
{%- endif -%}
{%- endfor %}
{%- if build_deps or run_deps or tools_apt -%}
###
### Install build_dep, run_dep or tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
{{- "\n" -}}
{%- if build_deps -%}
{{- "\t\t# ---------- build_deps ----------\n" -}}
{%- for apt in build_deps | unique | sort -%}
{{- "\t\t" + apt + " \\" + "\n" -}}
{%- endfor -%}
{%- endif -%}
{%- if run_deps -%}
{{- "\t\t# ---------- run_deps ----------\n" -}}
{%- for apt in run_deps | unique | sort -%}
{{- "\t\t" + apt + " \\" + "\n" -}}
{%- endfor -%}
{%- endif -%}
{%- if tools_apt -%}
{{- "\t\t# ---------- type: apt ----------\n" -}}
{%- for apt in tools_apt | unique | sort -%}
{{- "\t\t" + apt + " \\" + "\n" -}}
{%- endfor -%}
{%- endif -%}
{{- "\t" -}}&& rm -rf /var/lib/apt/lists/*{{- "\n" -}}
{% endif %}
###
### Install defined php_tools
###
{% for tool in tools_enabled -%}
{# Not disabled #}
{%- if ('disabled' not in tools_available[tool]) or (php_version not in tools_available[tool]['disabled']) -%}
{{- "\n" }}# -------------------- ({{ fn.get_type(php_version, tool, tools_available) }}) {{ tool }} --------------------
{{- "\n" }}RUN set -eux \
{#- -#}
{#- [PRE] -#}
{%- if fn.get_pre(php_version, tool, tools_available) | length -%}
{{ "\n\t" }}&& {{ fn.get_pre(php_version, tool, tools_available) | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- [CUSTOM] -#}
{%- if fn.get_type(php_version, tool, tools_available) == 'custom' -%}
{{ "\n\t" }}&& {{ fn.tool_custom_get_command(php_version, tool, tools_available) | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- [NPM] -#}
{%- if fn.get_type(php_version, tool, tools_available) == 'npm' -%}
{%- set npm_package = fn.tool_npm_get_package(php_version, tool, tools_available) -%}
{%- set npm_version = fn.tool_npm_get_version(php_version, tool, tools_available) -%}
{%- set npm_binary = fn.tool_npm_get_binary(php_version, tool, tools_available) -%}
{{ "\n\t" }}&& su -c '. {{ nvm_home }}/nvm.sh; npm install --location=global {{ npm_package }}{{ npm_version }}' devilbox \
{%- if npm_binary | length -%}
{{ "\n\t" }}&& ln -s {{ nvm_home }}/versions/node/$(su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox)/bin/{{ npm_binary }} /usr/local/bin/ \
{%- endif -%}
{%- endif -%}
{#- -#}
{#- [COMPOSER] -#}
{%- if fn.get_type(php_version, tool, tools_available) == 'composer' -%}
{%- set comp_composer = fn.tool_composer_get_composer(php_version, tool, tools_available) -%}
{%- set comp_package = fn.tool_composer_get_package(php_version, tool, tools_available) -%}
{%- set comp_version = fn.tool_composer_get_version(php_version, tool, tools_available) -%}
{%- set comp_flags = fn.tool_composer_get_flags(php_version, tool, tools_available) -%}
{%- set comp_binary = fn.tool_composer_get_binary(php_version, tool, tools_available) -%}
{#- FIXME: use su -c ' devilbox -#}
{{ "\n\t" }}&& COMPOSER_HOME="{{ composer_home }}" COMPOSER_MEMORY_LIMIT=-1 /usr/local/bin/composer-{{ comp_composer }} global require --no-interaction --no-cache {{ comp_flags }} {{ comp_package }}{{ comp_version }} \
{%- if comp_binary | length -%}
{{ "\n\t" }}&& ln -s {{ composer_home }}/vendor/{{ comp_package }}/{{ comp_binary }} /usr/local/bin/ \
{%- endif -%}
{{ "\n\t" }}&& rm -rf {{ composer_home }}/cache/* \
{%- endif -%}
{#- -#}
{#- [RUBYGEM] -#}
{%- if fn.get_type(php_version, tool, tools_available) == 'rubygem' -%}
{%- set rubygem_package = fn.tool_rubygem_get_package(php_version, tool, tools_available) -%}
{%- set rubygem_version = fn.tool_rubygem_get_version(php_version, tool, tools_available) -%}
{{ "\n\t" }}&& gem install {{ rubygem_package }}{{ rubygem_version }} \
{%- endif -%}
{#- -#}
{#- [PIP] -#}
{%- if fn.get_type(php_version, tool, tools_available) == 'pip' -%}
{%- set pip_package = fn.tool_pip_get_package(php_version, tool, tools_available) -%}
{%- set pip_version = fn.tool_pip_get_version(php_version, tool, tools_available) -%}
{{ "\n\t" }}&& pip install --no-cache-dir --no-compile --force-reinstall {{ pip_package }}{{ pip_version }} \
{%- endif -%}
{#- -#}
{#- [POST] -#}
{%- if fn.get_post(php_version, tool, tools_available) | length -%}
{{ "\n\t" }}&& {{ fn.get_post(php_version, tool, tools_available) | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- [CHECK] -#}
{%- if 'check' in tools_available[tool] -%}
{{ "\n\t" }}&& {{ tools_available[tool]['check'] | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{#- -#}
{#- Finalize -#}
{{ "\n\t" }}&& true{{ "\n" }}
{%- endif -%}
{%- endfor %}
###
### Post fixes
###
RUN set -eux \
&& if [ ! -d "/var/lib/gems" ]; then \
mkdir "/var/lib/gems"; \
fi
########################################################################################################################
########################################################################################################################
###
### Stage 5/7: Devilbox work image (TOOLS)
###
########################################################################################################################
########################################################################################################################
###
### This stage can be easily modified by adding tools into the ./php_tools/ directory.
###
FROM devilbox-work-help as devilbox-work-tools
{% set run_deps = [] -%}
{%- set tools_apt = [] -%}
{%- for tool in tools_enabled -%}
{%- for dep in fn.get_run_dep(php_version, tool, tools_available) | from_json -%}
{%- if dep -%}
{{- run_deps.append(dep) -}}
{%- endif -%}
{%- endfor -%}
{%- if ('disabled' not in tools_available[tool]) or (php_version not in tools_available[tool]['disabled']) -%}
{%- if fn.tool_apt_get_package(php_version, tool, tools_available) -%}
{{- tools_apt.append(fn.tool_apt_get_package(php_version, tool, tools_available)) -}}
{%- endif -%}
{%- endif -%}
{%- endfor %}
{%- if build_deps or run_deps or tools_apt -%}
###
### Install run_dep or tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
{{- "\n" -}}
{%- if run_deps -%}
{{- "\t\t# ---------- run_deps ----------\n" -}}
{%- for apt in run_deps | unique | sort -%}
{{- "\t\t" + apt + " \\" + "\n" -}}
{%- endfor -%}
{%- endif -%}
{%- if tools_apt -%}
{{- "\t\t# ---------- type: apt ----------\n" -}}
{%- for apt in tools_apt | unique | sort -%}
{{- "\t\t" + apt + " \\" + "\n" -}}
{%- endfor -%}
{%- endif -%}
{{- "\t" -}}&& rm -rf /var/lib/apt/lists/*{{- "\n" -}}
{% endif %}
###
### Copy Custom (binaries in /usr/local/bin)
###
COPY --from=devilbox-work-tools-builder /usr/local/bin /usr/local/bin
###
### Copy NPM
###
COPY --from=devilbox-work-tools-builder /opt/nvm /opt/nvm
###
### Copy Composer
###
COPY --from=devilbox-work-tools-builder /usr/local/src /usr/local/src
###
### Copy Pip
###
COPY --from=devilbox-work-tools-builder /usr/local/lib /usr/local/lib
###
### Copy RubyGems
###
COPY --from=devilbox-work-tools-builder /var/lib/gems /var/lib/gems
# FIXME: / TODO: Add post: stage into here as well
########################################################################################################################
########################################################################################################################
###
### Stage 6/7: Devilbox work image (TOOLS TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-work-tools as devilbox-work-tools-test
{% for tool in tools_enabled -%}
{%- if fn.is_not_disabled(php_version, tool, tools_available) -%}
{{- "\n" }}# -------------------- ({{ fn.get_type(php_version, tool, tools_available) }}) {{ tool }} --------------------
{{- "\n" }}RUN set -eux \
{%- if 'check' in tools_available[tool] -%}
{{ "\n\t" }}&& {{ tools_available[tool]['check'] | indent( "\t" ) }}{{ "\t\\" }}
{%- endif -%}
{{ "\n\t" }}&& true{{ "\n" }}
{%- endif -%}
{%- endfor %}
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^{{ php_version }}' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 7/7: Devilbox sliwork image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: work)
###
FROM devilbox-work-tools as work
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="{{ php_version }}-work"
LABEL "org.opencontainers.image.title"="PHP-FPM {{ php_version }}-work"
LABEL "org.opencontainers.image.description"="PHP-FPM {{ php_version }}-work"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

16
.ansible/ansible.cfg Normal file
View File

@@ -0,0 +1,16 @@
[defaults]
roles_path = ./roles
inventory = inventory.ini
strategy_plugins = /usr/lib/python3.10/site-packages/ansible_mitogen/plugins/strategy
strategy = mitogen_linear
# Show timing information
callbacks_enabled = timer, profile_tasks, profile_roles
# Speed improvements
host_key_checking = False
internal_poll_interval = 0.001
[ssh_connection]
pipelining = True
ssh_args = -o ControlMaster=auto -o ControlPersist=60s

View File

@@ -0,0 +1,84 @@
---
###################################################################################################
# Ansible specific definitions
###################################################################################################
edit_comment_base: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead."
edit_comment_mods: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-mods.j2 instead."
edit_comment_prod: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead."
edit_comment_slim: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead."
edit_comment_work: "# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-work.j2 instead."
# -------------------------------------------------------------------------------------------------
# Adds version checks to Dockerfile
# -------------------------------------------------------------------------------------------------
debug: True
# Also implement checks in builder images (slow, but fails faster)
build_fail_fast: False
# -------------------------------------------------------------------------------------------------
# Available PHP versions (see inventory)
# -------------------------------------------------------------------------------------------------
php_all_versions:
- 5.2
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
- 8.2
# -------------------------------------------------------------------------------------------------
# Docker file paths for each version for base, mods, prod, slim & work
# -------------------------------------------------------------------------------------------------
template_dockerfiles:
- src: DOCKERFILES/Dockerfile-base.j2
dst: "../Dockerfiles/base/Dockerfile-{{ php_version }}"
- src: DOCKERFILES/Dockerfile-mods.j2
dst: "../Dockerfiles/mods/Dockerfile-{{ php_version }}"
- src: DOCKERFILES/Dockerfile-prod.j2
dst: "../Dockerfiles/prod/Dockerfile-{{ php_version }}"
- src: DOCKERFILES/Dockerfile-slim.j2
dst: "../Dockerfiles/slim/Dockerfile-{{ php_version }}"
- src: DOCKERFILES/Dockerfile-work.j2
dst: "../Dockerfiles/work/Dockerfile-{{ php_version }}"
# -------------------------------------------------------------------------------------------------
# Assign php.ini & php-fpm.conf to PHP versions
# -------------------------------------------------------------------------------------------------
template_configurations:
# php.ini
- src: CONFIGURATIONS/php.ini.j2
dst: "../Dockerfiles/base/data/php-ini.d/php-{{ php_version }}.ini"
cfg: "{{ php_settings_ini }}"
key: base
alt: base
- src: CONFIGURATIONS/php.ini.j2
dst: "../Dockerfiles/slim/data/php-ini.d/php-{{ php_version }}.ini"
cfg: "{{ php_settings_ini }}"
key: slim
alt: base # Alternative key to use when definition is not set in 'slim'
# php-fpm.conf
- src: CONFIGURATIONS/php-fpm.conf.j2
dst: "../Dockerfiles/base/data/php-fpm.conf/php-fpm-{{ php_version }}.conf"
cfg: "{{ php_settings_fpm }}"
key: base
alt: base
- src: CONFIGURATIONS/php-fpm.conf.j2
dst: "../Dockerfiles/slim/data/php-fpm.conf/php-fpm-{{ php_version }}.conf"
cfg: "{{ php_settings_fpm }}"
key: slim
alt: base # Alternative key to use when definition is not set in 'slim'

View File

@@ -0,0 +1,117 @@
---
###################################################################################################
# PHP php.ini php-fpm.conf settings
###################################################################################################
# -------------------------------------------------------------------------------------------------
# Global
# -------------------------------------------------------------------------------------------------
php_timeout: 120
# -------------------------------------------------------------------------------------------------
# php.ini
# -------------------------------------------------------------------------------------------------
php_settings_ini:
# ---- Sane default ----
base:
# Memory
memory_limit: 512M
# Timeouts
max_execution_time: "{{ php_timeout }}"
max_input_time: "{{ php_timeout }}"
# Uploads
# Note: "post_max_size" should be greater than "upload_max_filesize"
post_max_size: 72M
upload_max_filesize: 64M
max_file_uploads: 20
# Variables
variables_order: EGPCS
max_input_vars: 8000
max_input_nesting_level: 64
# Error reporting
error_reporting: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
xmlrpc_errors: 'Off'
report_memleaks: 'On'
display_errors: 'Off'
display_startup_errors: 'Off'
track_errors: 'On'
log_errors: 'On'
html_errors: 'Off'
# Xdebug2 settings
xdebug2_default_enable: 'Off'
xdebug2_profiler_enable: 'Off'
xdebug2_remote_enable: 'Off'
xdebug2_remote_autostart: 'Off'
# Xdebug3 settings
xdebug3_mode: 'Off'
xdebug3_start_with_request: 'default'
xdebug3_client_port: '9000'
# ---- Inherits from base ----
mods:
# ---- Inherits from base ----
prod:
# ---- Inherits from base and overwrites certain values ----
slim:
# Error reporting
error_reporting: E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED
xmlrpc_errors: 'Off'
report_memleaks: 'On'
display_errors: 'On'
display_startup_errors: 'On'
track_errors: 'On'
log_errors: 'On'
html_errors: 'On'
# Xdebug2 settings
xdebug2_default_enable: 'Off'
xdebug2_profiler_enable: 'Off'
xdebug2_remote_enable: 'Off'
xdebug2_remote_autostart: 'Off'
# Xdebug3 settings
xdebug3_mode: 'Off'
xdebug3_start_with_request: 'default'
xdebug3_client_port: '9000'
# ---- Inherits from slim ----
work:
# -------------------------------------------------------------------------------------------------
# php-fpm.conf
# -------------------------------------------------------------------------------------------------
php_settings_fpm:
# ---- Sane default ----
base:
# Docker
clear_env: 'no'
catch_workers_output: 'yes'
# Timeouts
request_terminate_timeout: "{{ php_timeout }}s"
# Network
listen: 9000
# Backlog
listen_backlog: 1024
# Logging
log_level: notice
error_log: /proc/self/fd/2
access_log: /proc/self/fd/2
# Worker
pm: ondemand
pm_max_children: 50 # pm: dynamic, ondemand or static
pm_start_servers: 4 # only for pm: dynamic (min_spare + (max_spare-min_spare)/2
pm_min_spare_servers: 2 # only for pm: dynamic
pm_max_spare_servers: 6 # only for pm: dynamic
pm_max_requests: 500 # pm: dynamic or ondemand
pm_process_idle_timeout: 10s # only for pm: ondemand
# User/Group
user: devilbox
group: devilbox
# ---- Inherits from base ----
mods:
# ---- Inherits from base ----
prod:
# ---- Inherits from base ----
slim:
# ---- Inherits from base ----
work:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,573 @@
---
###################################################################################################
# Docker: slim
###################################################################################################
#
# This file holds definition for all devibox/php-fpm:x.y-slim images
#
###
### Define operating system versions
###
os_release:
# Bullseye (Ubuntu: focal, groovy, hirsute, impish)
all:
debian: bullseye
ubuntu: focal
8.2:
debian: bullseye
ubuntu: focal
8.1:
debian: bullseye
ubuntu: focal
8.0:
debian: bullseye
ubuntu: focal
7.4:
debian: bullseye
ubuntu: focal
7.3:
debian: bullseye
ubuntu: focal
# Buster (Ubuntu: bionic, cosmic, disco, eoan)
7.2:
debian: buster
ubuntu: bionic
7.1:
debian: buster
ubuntu: bionic
# Strech (Ubuntu: xenial, yakkety, zesty, artful)
7.0:
debian: stretch
ubuntu: xenial
5.6:
debian: stretch
ubuntu: xenial
# Jessie (Ubuntu: trusty, utopic, vivid, wily)
5.5:
debian: jessie
ubuntu: trusty
5.4:
debian: jessie
ubuntu: trusty
5.3:
debian: jessie
ubuntu: trusty
5.2:
debian: jessie
ubuntu: trusty
# -------------------------------------------------------------------------------------------------
# Apt repositories to enable (in defined order)
# -------------------------------------------------------------------------------------------------
base_apt_repositories_enabled:
- backports
- blackfire
# - mongo # Note: This is done separately in tools (to check ARCH as well)
# - pgsql # Note: This is done separately in tools (to check ARCH as well)
# -------------------------------------------------------------------------------------------------
# Software to install (in defined order)
# -------------------------------------------------------------------------------------------------
base_software_enabled:
- dig # required by Devilbox Intranet
- netcat # required by Devilbox Intranet
- ping # required by Devilbox Intranet
- sudo # required by /etc/sudoers.d/devilbox config file
- blackfire
- mhsendmail
- mongo_client
- mysqldumpsecure
- pgsql_client
# -------------------------------------------------------------------------------------------------
# Apt repository definition
# -------------------------------------------------------------------------------------------------
# all: is generic version of defines
# 7.2: is specific version of defines
# disabled: [optional] Array of PHP versions for which to disable this module
#
# all, 7.2, 7.1, 7.0, 5.6, 5.5, 5.4:
# deb: Deb line to add to sources list
# key: [optional] Key id to add for repository
# pre: [optional] Run custom command to add gpg key for repository
#
base_apt_repositories_available:
###
### Backports
###
backports:
# [Bullseye]
all:
type: repo
pre: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
deb: deb http://ftp.debian.org/debian {{ os_release['all'].debian }}-backports main
# [Buster]
7.2:
type: repo
pre: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
deb: deb http://ftp.debian.org/debian {{ os_release[7.2].debian }}-backports main
# [Buster]
7.1:
type: repo
pre: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
deb: deb http://ftp.debian.org/debian {{ os_release[7.1].debian }}-backports main
# [Stretch]
7.0:
type: repo
pre: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
deb: deb http://ftp.debian.org/debian {{ os_release[7.0].debian }}-backports main
# [Stretch]
5.6:
type: repo
pre: apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
deb: deb http://ftp.debian.org/debian {{ os_release[5.6].debian }}-backports main
# [Jessie]
5.5:
type: repo
pre: echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until
deb: deb [trusted=yes] http://archive.debian.org/debian {{ os_release[5.5].debian }}-backports main
# [Jessie]
5.4:
type: repo
pre: echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until
deb: deb [trusted=yes] http://archive.debian.org/debian {{ os_release[5.4].debian }}-backports main
# [Jessie]
5.3:
type: repo
pre: echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until
deb: deb [trusted=yes] http://archive.debian.org/debian {{ os_release[5.3].debian }}-backports main
# [Jessie]
5.2:
type: repo
pre: echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until
deb: deb [trusted=yes] http://archive.debian.org/debian {{ os_release[5.2].debian }}-backports main
###
### Blackfire
###
blackfire:
all:
type: repo
deb: deb http://packages.blackfire.io/debian any main
pre: curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -
###
### MongoDB (currently obsolete)
###
mongo:
# 8.2: mongodb-org-(tools|shell) (amd64, arm64)
# 8.1: mongodb-org-(tools|shell) (amd64, arm64)
# 8.0: mongodb-org-(tools|shell) (amd64, arm64)
# 7.4: mongodb-org-(tools|shell) (amd64, arm64)
# 7.3: mongodb-org-(tools|shell) (amd64, arm64)
# 7.2: mongo-tools OR mongodb-org-(tools|shell) (amd64, arm64)
# 7.1: mongo-tools OR mongodb-org-(tools|shell) (amd64, arm64)
# 7.0: mongodb-clients & mongo-tools (amd64, arm64)
# 5.6: mongodb-clients & mongo-tools (amd64, arm64)
# 5.5: mongodb-clients (amd64)
# 5.4: mongodb-clients (amd64)
# 5.3: mongodb-clients (amd64)
# 5.2: mongodb-clients (amd64)
disabled: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0] # TODO: Why were those disabled?
# [Bullseye] Ubuntu repository required for arm64 support instead
all:
type: repo
# gpg --dry-run --with-fingerprint < <(curl https://www.mongodb.org/static/pgp/server-4.4.asc) | grep fingerprint | sed 's/.*=//g' | sed 's/ //g'
deb: deb http://repo.mongodb.org/apt/ubuntu {{ os_release['all'].ubuntu }}/mongodb-org/4.4 multiverse
key: 20691EEC35216C63CAF66CE1656408E390CFB1F5
# [Buster] Ubuntu repository required for arm64 support instead
7.2:
type: repo
# gpg --dry-run --with-fingerprint < <(curl https://www.mongodb.org/static/pgp/server-4.4.asc) | grep fingerprint | sed 's/.*=//g' | sed 's/ //g'
deb: deb http://repo.mongodb.org/apt/ubuntu {{ os_release[7.2].ubuntu }}/mongodb-org/4.4 multiverse
key: 20691EEC35216C63CAF66CE1656408E390CFB1F5
# [Buster] Ubuntu repository required for arm64 support instead
7.1:
type: repo
# gpg --dry-run --with-fingerprint < <(curl https://www.mongodb.org/static/pgp/server-4.4.asc) | grep fingerprint | sed 's/.*=//g' | sed 's/ //g'
deb: deb http://repo.mongodb.org/apt/ubuntu {{ os_release[7.1].ubuntu }}/mongodb-org/4.4 multiverse
key: 20691EEC35216C63CAF66CE1656408E390CFB1F5
###
### PostgrSQL (currently obsolete)
###
pgsql:
# [Bullseye]
all:
type: repo
deb: deb http://apt.postgresql.org/pub/repos/apt/ {{ os_release['all'].debian }}-pgdg main
pre: curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -
# [Buster]
7.2:
type: repo
deb: deb http://apt.postgresql.org/pub/repos/apt/ {{ os_release[7.2].debian }}-pgdg main
pre: curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -
# [Buster]
7.1:
type: repo
deb: deb http://apt.postgresql.org/pub/repos/apt/ {{ os_release[7.1].debian }}-pgdg main
pre: curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -
# [Stretch]
7.0:
type: repo
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[7.0].debian }}-pgdg main
# [Stretch]
5.6:
type: repo
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[5.6].debian }}-pgdg main
# [Jessie]
5.5:
type: repo
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[5.5].debian }}-pgdg main
# [Jessie]
5.4:
type: repo
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[5.4].debian }}-pgdg main
# [Jessie]
5.3:
type: repo
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[5.3].debian }}-pgdg main
# [Jessie]
5.2:
type: repo
deb: deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[5.2].debian }}-pgdg main
# -------------------------------------------------------------------------------------------------
# Essential Software definition
# -------------------------------------------------------------------------------------------------
# all: is generic version of defines
# 7.2: is specific version of defines
# disabled: [optional] Array of PHP versions for which to disable this module
# check: [optional] Include a check command to test if it was installed successfully
#
# all, 7.2, 7.1, 7.0, 5.6, 5.5, 5.4:
# pre: [optional] Run command before 'command:' statement
# command: Command to execute
# post: [optional] Run command after 'command:' statement
#
base_software_available:
###
### dig
###
dig:
check: dig -v 2>&1 | grep -E '[0-9]\.[0-9]'
all:
type: apt
package: dnsutils
###
### netcat
###
netcat:
check: nc -h 2>&1 | grep netcat
all:
type: apt
package: netcat-openbsd
###
### ping
###
ping:
check: ping -V | grep ^ping
all:
type: apt
package: iputils-ping
###
### sudo
###
sudo:
check: sudo --version | grep -E 'version [0-9]+\.[0-9]+'
all:
type: apt
package: sudo
###
### Blackfire
###
blackfire:
check: |
blackfire version \
&& blackfire-agent -v \
all:
type: custom
pre: |
apt-get update \
command: |
apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
post: rm -rf /var/lib/apt/lists/*
###
### mhsendmail
###
mhsendmail:
check: mhsendmail -h 2>&1 | grep 'Usage'
all:
type: custom
command: |
DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
###
### MongoDB Command line client
###
# 8.2: mongodb-org-(tools|shell) (amd64, arm64)
# 8.1: mongodb-org-(tools|shell) (amd64, arm64)
# 8.0: mongodb-org-(tools|shell) (amd64, arm64)
# 7.4: mongodb-org-(tools|shell) (amd64, arm64)
# 7.3: mongodb-org-(tools|shell) (amd64, arm64)
# 7.2: mongodb-org-(tools|shell) (amd64, arm64)
# 7.1: mongodb-org-(tools|shell) (amd64, arm64)
# 7.0: mongodb-clients & mongo-tools (amd64, arm64)
# 5.6: mongodb-clients & mongo-tools (amd64, arm64)
# 5.5: mongodb-clients (amd64)
# 5.4: mongodb-clients (amd64)
# 5.3: mongodb-clients (amd64)
# 5.2: mongodb-clients (amd64)
mongo_client:
check: |
if echo '{{ php_version }}' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '{{ php_version }}' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
all:
type: custom
pre: |
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
&& echo "deb http://repo.mongodb.org/apt/ubuntu {{ os_release[php_version].ubuntu }}/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
&& apt-get update \
command: |
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-org-tools \
mongodb-org-shell \
post: rm -rf /var/lib/apt/lists/*
build_dep: [libsnappy-dev] # Required to copy libsnappy.so to next stage
7.0:
type: custom
pre: apt-get update
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients \
mongo-tools; \
else \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
5.6:
type: custom
pre: apt-get update
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients \
mongo-tools; \
else \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
5.5:
type: custom
pre: apt-get update
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
5.4:
type: custom
pre: apt-get update
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
5.3:
type: custom
pre: apt-get update
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
5.2:
type: custom
pre: apt-get update
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
###
### mysqldump-secure
###
mysqldumpsecure:
check: mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+'
all:
type: custom
command: |
git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
###
### PostgrSQL Command line client
###
# 8.2: (amd64, arm64)
# 8.1: (amd64, arm64)
# 8.0: (amd64, arm64)
# 7.4: (amd64, arm64)
# 7.3: (amd64, arm64)
# 7.2: (amd64, arm64)
# 7.1: (amd64, arm64)
# 7.0: (amd64)
# 5.6: (amd64)
# 5.5: (amd64)
# 5.4: (amd64)
# 5.3: (amd64)
# 5.2: (amd64)
pgsql_client:
check: |
if echo '{{ php_version }}' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
all:
type: custom
pre: |
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update \
command: |
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client \
post: rm -rf /var/lib/apt/lists/*
7.0:
type: custom
pre: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \
5.6:
type: custom
pre: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \
5.5:
type: custom
pre: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \
5.4:
type: custom
pre: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \
5.3:
type: custom
pre: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \
5.2:
type: custom
pre: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ {{ os_release[php_version].debian }}-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
command: |
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \

View File

@@ -0,0 +1,239 @@
---
###################################################################################################
# Docker: work (docker stage: help)
###################################################################################################
#
# This file holds definition for all devibox/php-fpm:x.y-work images
#
# -------------------------------------------------------------------------------------------------
# Global variables
# -------------------------------------------------------------------------------------------------
composer_home: /usr/local/src/composer
nvm_home: /opt/nvm
node_version: --lts
# -------------------------------------------------------------------------------------------------
# Software to install (in defined order)
# -------------------------------------------------------------------------------------------------
help_software_enabled:
- composer
- nvm
- pip
## -------------------------------------------------------------------------------------------------
## Software definition
## -------------------------------------------------------------------------------------------------
#
# all: is generic version of defines
# 7.2: is specific version of defines
# disabled: [optional] Array of PHP versions for which to disable this module
# check: [optional] Include a check command to test if it was installed successfully
#
# all, 7.2, 7.1, 7.0, 5.6, 5.5, 5.4:
# pre: [optional] Run command before 'command:' statement
# command: Command to execute
# post: [optional] Run command after 'command:' statement
#
help_software_available:
###
### Composer
###
composer:
disabled: [5.2]
check: composer --version 2>/dev/null | grep -Ei '(composer|version)\s*[0-9][.0-9]+'
all:
type: custom
pre: |
COMPOSER_1_VERSION="latest-1.x" \
&& COMPOSER_2_VERSION="latest-2.x" \
command: |
curl -sS -L --fail "https://getcomposer.org/download/${COMPOSER_1_VERSION}/composer.phar" > /usr/local/bin/composer-1 \
&& curl -sS -L --fail "https://getcomposer.org/download/${COMPOSER_2_VERSION}/composer.phar" > /usr/local/bin/composer-2 \
&& chmod +x /usr/local/bin/composer-1 \
&& chmod +x /usr/local/bin/composer-2 \
post: |
ln -sf /usr/local/bin/composer-2 /usr/local/bin/composer \
run_dep: [unzip] # Required for composer to unzip packages
7.1:
type: custom
pre: |
COMPOSER_1_VERSION="latest-1.x" \
&& COMPOSER_2_VERSION="latest-2.2.x" \
7.0:
type: custom
pre: |
COMPOSER_1_VERSION="latest-1.x" \
&& COMPOSER_2_VERSION="latest-2.2.x" \
5.6:
type: custom
pre: |
COMPOSER_1_VERSION="latest-1.x" \
&& COMPOSER_2_VERSION="latest-2.2.x" \
5.5:
type: custom
pre: |
COMPOSER_1_VERSION="latest-1.x" \
&& COMPOSER_2_VERSION="latest-2.2.x" \
5.4:
type: custom
pre: |
COMPOSER_1_VERSION="latest-1.x" \
&& COMPOSER_2_VERSION="latest-2.2.x" \
5.3:
type: custom
pre: |
COMPOSER_1_VERSION="latest-1.x" \
&& COMPOSER_2_VERSION="latest-2.2.x" \
post: |
ln -sf /usr/local/bin/composer-1 /usr/local/bin/composer \
###
### nvm
###
nvm:
check: |
su -c '. {{ nvm_home }}/nvm.sh; nvm --version' devilbox | grep -E '^v?[0-9][.0-9]+' \
&& su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox | grep -E '^v?[0-9][.0-9]+' \
&& su -c '. {{ nvm_home }}/nvm.sh; yarn --version' devilbox | grep -E '^v?[0-9][.0-9]+' \
all:
type: custom
pre: |
NODE_VERSION="{{ node_version }}" \
command: |
NVM_VERSION="$( \
curl -sS 'https://github.com/nvm-sh/nvm/releases' \
| grep -Eo '/nvm-sh/nvm/releases/tag/v?[.0-9]+"' \
| grep -Eo 'v?[.0-9]+' \
| sort -V \
| tail -1 \
)" \
&& mkdir -p {{ nvm_home }} \
&& curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh" \
| NVM_DIR="{{ nvm_home }}" bash \
\
&& chown -R devilbox:devilbox "{{ nvm_home }}" \
# Install latest and LTS version and yarn
post: |
su -c ". {{ nvm_home }}/nvm.sh; nvm install ${NODE_VERSION}" devilbox \
&& su -c ". {{ nvm_home }}/nvm.sh; nvm use ${NODE_VERSION}" devilbox \
&& su -c ". {{ nvm_home }}/nvm.sh; corepack enable" devilbox \
\
&& ln -s "{{ nvm_home }}/versions/node/$(su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox)/bin/corepack" /usr/local/bin/ \
&& ln -s "{{ nvm_home }}/versions/node/$(su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox)/bin/node" /usr/local/bin/ \
&& ln -s "{{ nvm_home }}/versions/node/$(su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox)/bin/npm" /usr/local/bin/ \
&& ln -s "{{ nvm_home }}/versions/node/$(su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox)/bin/npx" /usr/local/bin/ \
&& ln -s "{{ nvm_home }}/versions/node/$(su -c '. {{ nvm_home }}/nvm.sh; node --version' devilbox)/bin/yarn" /usr/local/bin/ \
\
&& chmod 0777 {{ nvm_home }} \
&& find {{ nvm_home }} -type f -print0 | xargs -n1 -0 chmod go+w \
&& find {{ nvm_home }} -type d -print0 | xargs -n1 -0 chmod 0777 \
\
&& rm -rf {{ nvm_home }}/.cache \
&& rm -rf {{ nvm_home }}/versions/node/$(su -c '. /opt/nvm/nvm.sh; node --version' devilbox)/share \
&& rm -rf {{ nvm_home }}/versions/node/$(su -c '. /opt/nvm/nvm.sh; node --version' devilbox)/include \
7.0:
type: custom
pre: |
NODE_VERSION="17" \
5.6:
type: custom
pre: |
NODE_VERSION="17" \
5.5:
type: custom
pre: |
NODE_VERSION="17" \
5.4:
type: custom
pre: |
NODE_VERSION="17" \
5.3:
type: custom
pre: |
NODE_VERSION="17" \
5.2:
type: custom
pre: |
NODE_VERSION="17" \
###
### Python pip
###
pip:
check: pip --version
all:
type: custom
command: |
curl -sS -L --fail https://bootstrap.pypa.io/get-pip.py | python3 \
# Cleanup
post: |
/bin/ls -1 /usr/local/lib/ | grep ^python | while read -r version; do \
cd "/usr/local/lib/${version}/" \
&& find . -name '*.pyc' -print0 | xargs -0 -n1 rm -rf \
&& find . -name '*.exe' -print0 | xargs -0 -n1 rm -rf \
&& find . -name '__pycache__' -print0 | xargs -0 -n1 rm -rf \
\
&& if [ -d "dist-packages" ]; then \
cd "dist-packages" \
&& pwd \
&& if /bin/ls -1 | grep -v '^pip'; then \
/bin/ls -1 | grep -v '^pip' | xargs -n1 rm -rf; \
fi \
fi \
done \
run_dep: [python3-distutils]
build_dep: [libpython3-dev]
7.2:
type: custom
command: |
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
run_dep: []
build_dep: [libpython-dev]
7.1:
type: custom
command: |
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
run_dep: []
build_dep: [libpython-dev]
7.0:
type: custom
command: |
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
run_dep: []
build_dep: [libpython-dev]
5.6:
type: custom
command: |
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
run_dep: []
build_dep: [libpython-dev]
5.5:
type: custom
command: |
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
run_dep: []
build_dep: [libpython-dev]
5.4:
type: custom
command: |
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
run_dep: []
build_dep: [libpython-dev]
5.3:
type: custom
run_dep: []
build_dep: [libpython-dev]
command: |
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
5.2:
type: custom
command: |
curl -sS -L --fail https://bootstrap.pypa.io/pip/2.7/get-pip.py | python \
run_dep: []
build_dep: [libpython-dev]

View File

@@ -0,0 +1,717 @@
---
# DO NOT ALTER THIS FILE - IT IS AUTOGENERATED.
# The following specifies the order in which tools are being installed.
tools_enabled:
- angular-cli
- asgardcms
- eslint
- git
- jsonlint
- mdl
- awesome-ci
- codeception
- deployer
- git-flow
- grunt-cli
- gulp
- jq
- laravel-installer
- laravel-lumen
- linkcheck
- mdlint
- mupdf-tools
- phalcon-devtools
- php-cs-fixer
- phpcbf
- phpcs
- phpmd
- phpunit
- pm2
- pwncat
- ssh
- rsync
- sass
- shellcheck
- stylelint
- svn
- symfony-cli
- taskfile
- tig
- vim
- vue-cli
- webpack-cli
- wkhtmltopdf
- wp-cli
- yamllint
- yq
- zsh
# The following specifies how tools are being installed.
tools_available:
angular-cli:
disabled: []
check: ng version 2>&1 | grep -iE 'Angular CLI:\s*[0-9][.0-9]+' || (ng version; false)
all:
type: npm
package: "@angular/cli"
binary: ng
version:
build_dep: []
run_dep: []
pre:
post:
asgardcms:
disabled: [5.2, 5.3, 5.4]
check: asgardcms --version 2>/dev/null | grep -Ei 'AsgardCMS\sInstaller\s[0-9][.0-9]+' || (asgardcms --version; false)
all:
type: composer
composer: 2
package: asgardcms/asgardcms-installer
# https://github.com/AsgardCms/asgardcms-installer/issues/1
version: dev-master
flags:
binary: asgardcms
build_dep: []
run_dep: []
pre:
post:
eslint:
disabled: []
check: eslint -v | grep -E '[0-9][.0-9]+' || (eslint -v; false)
all:
type: npm
package: "eslint"
binary: eslint
version:
build_dep: []
run_dep: []
pre:
post:
git:
disabled: []
check: git --version 2>&1 | grep -E '[0-9][.0-9]+' || (git --version; false)
all:
type: apt
package: git
jsonlint:
disabled: []
check: jsonlint --version | grep -E '[0-9][.0-9]+' || (jsonlint --version; false)
all:
type: npm
package: jsonlint
binary: jsonlint
version:
build_dep: []
run_dep: []
pre:
post:
mdl:
disabled: []
check: mdl --version | grep -E '[.0-9]+' || (mdl --version; false)
all:
type: rubygem
package: mdl
# version:
build_dep: [ruby-dev]
run_dep: [ruby]
# pre:
# post:
7.2:
type: rubygem
version: 0.11.0
pre: |
gem install chef-utils -v 16.6.14 \
7.1:
type: rubygem
version: 0.11.0
pre: |
gem install chef-utils -v 16.6.14 \
7.0:
type: rubygem
version: 0.5.0
pre: |
gem install mixlib-config -v 2.2.4 \
5.6:
type: rubygem
version: 0.5.0
pre: |
gem install mixlib-config -v 2.2.4 \
5.5:
type: rubygem
version: 0.5.0
pre: |
gem install mixlib-config -v 2.2.4 \
5.4:
type: rubygem
version: 0.5.0
pre: |
gem install mixlib-config -v 2.2.4 \
5.3:
type: rubygem
version: 0.5.0
pre: |
gem install mixlib-config -v 2.2.4 \
5.2:
type: rubygem
version: 0.5.0
pre: |
gem install mixlib-config -v 2.2.4 \
awesome-ci:
disabled: []
check: regex-grep --version | grep -E '[0-9][.0-9]+' || (regex-grep --version; false)
all:
type: custom
command: |
git clone https://github.com/cytopia/awesome-ci.git /tmp/awesome-ci \
&& cd /tmp/awesome-ci \
&& git checkout $(git describe --abbrev=0 --tags) \
&& ./configure --prefix=/usr/local \
&& make install \
&& cd / \
&& rm -rf /tmp/awesome-ci \
# moreutils: isutf8
run_dep: [dos2unix, file, moreutils]
codeception:
disabled: [5.2, 5.3]
check: codecept --version 2>/dev/null | grep -E '^Codeception(\sversion)?\s[0-9][.0-9]+$' || (codecept --version; false)
all:
type: composer
composer: 2
package: codeception/codeception
# version:
flags:
binary: codecept
build_dep: []
run_dep: []
# pre:
# post:
deployer:
disabled: [5.2, 5.3]
check: dep --version 2>/dev/null | grep -Ei 'deployer\s*(version\s*)?[0-9][.0-9]+' || (dep --version; false)
all:
type: custom
command: curl -sS -k -L --fail https://deployer.org/deployer.phar -L -o /usr/local/bin/dep
post: chmod +x /usr/local/bin/dep
7.1:
type: custom
command: curl -sS -k -L --fail https://deployer.org/releases/v6.7.0/deployer.phar -L -o /usr/local/bin/dep
7.0:
type: custom
command: curl -sS -k -L --fail https://deployer.org/releases/v6.7.0/deployer.phar -L -o /usr/local/bin/dep
5.6:
type: custom
command: curl -sS -k -L --fail https://deployer.org/releases/v4.3.4/deployer.phar -L -o /usr/local/bin/dep
5.5:
type: custom
command: curl -sS -k -L --fail https://deployer.org/releases/v4.3.4/deployer.phar -L -o /usr/local/bin/dep
5.4:
type: custom
command: curl -sS -k -L --fail https://deployer.org/releases/v3.3.0/deployer.phar -L -o /usr/local/bin/dep
git-flow:
disabled: []
check: git-flow version 2>&1 | grep -E '[0-9][.0-9]+' || (git-flow version; false)
all:
type: custom
command: |
git clone https://github.com/petervanderdoes/gitflow-avh /tmp/gitflow \
&& cd /tmp/gitflow \
&& make install \
&& cd / && rm -rf /tmp/gitflow \
grunt-cli:
disabled: []
check: grunt --version | grep -E '[0-9][.0-9]+' || (grunt --version; false)
all:
type: npm
package: "grunt-cli"
binary: grunt
version:
build_dep: []
run_dep: []
pre:
post:
gulp:
disabled: []
check: gulp --version | grep -E '[0-9][.0-9]+' || (gulp --version; false)
all:
type: npm
package: gulp
binary: gulp
version:
build_dep: []
run_dep: []
pre:
post:
jq:
disabled: []
check: jq --version 2>&1 | grep -E '[0-9][.0-9]+' || (jq --version; false)
all:
type: apt
package: jq
laravel-installer:
disabled: [5.2, 5.3]
check: laravel --version | grep ^Laravel | grep -E '[0-9]\.[0-9]+' || (laravel --version; false)
all:
type: composer
composer: 2
package: laravel/installer
# version:
flags:
binary: bin/laravel
build_dep: []
run_dep: []
7.2:
type: composer
version: 4.0.0
7.1:
type: composer
binary: laravel
version: 2.3.0
7.0:
type: composer
binary: laravel
version: 2.2.0
5.6:
type: composer
binary: laravel
version: 2.2.0
5.5:
type: composer
binary: laravel
version: 2.2.0
5.4:
type: composer
binary: laravel
version: 1.3.7
laravel-lumen:
disabled: [5.2, 5.3, 5.4]
check: lumen --version 2>/dev/null | grep ^Lumen | grep -E '[0-9]\.[0-9]+' || (lumen --version; false)
all:
type: composer
composer: 2
package: laravel/lumen-installer
# version:
flags:
binary: lumen
build_dep: []
run_dep: []
# pre:
# post:
linkcheck:
disabled: []
check: linkcheck --version | grep -E 'v[0-9][.0-9]+' || (linkcheck --version; false)
all:
type: custom
command: curl -sS -L --fail -o /usr/local/bin/linkcheck https://raw.githubusercontent.com/cytopia/linkcheck/master/linkcheck
post: chmod +x /usr/local/bin/linkcheck
build_dep: []
run_dep: []
mdlint:
disabled: []
check: mdlint --version | grep -E '[0-9][.0-9]+' || (mdlint --version; false)
all:
type: npm
package: mdlint
binary: mdlint
version:
build_dep: []
run_dep: []
pre:
post:
mupdf-tools:
disabled: []
check: |
PHP_VERSION="$(php -v | grep ^PHP | awk '{print $2}' | grep -Eo '[0-9]\.[0-9]')" \
&& if echo "${PHP_VERSION}" | grep -E '5\.2|5\.3|5\.4|5\.5'; then \
mutool 2>&1 | grep ^usage; \
else \
echo test > test.txt \
&& mutool create -o test.pdf test.txt \
&& file test.pdf | grep 'PDF document' \
&& rm test.txt \
&& rm test.pdf; \
fi \
all:
type: apt
package: mupdf-tools
phalcon-devtools:
disabled: [5.2, 5.3, 5.4, 8.2]
check: |
if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi \
\
\
&& phalcon commands | grep -E '[0-9][.0-9]+' || (phalcon commands; false) \
\
\
&& if [ -f /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini ]; then \
rm /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if [ -f /usr/local/etc/php/conf.d/docker-php-ext-psr.ini ]; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi \
all:
type: composer
composer: 2
package: phalcon/devtools
binary: phalcon
# Enable phalcon.so (and its requirement psr prior installing)
pre: |
if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi \
# Disable phalcon.so (and its requirement psr after installing)
post: |
if [ -f /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini ]; then \
rm /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if [ -f /usr/local/etc/php/conf.d/docker-php-ext-psr.ini ]; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi \
7.1:
type: composer
version: 3.4.11
7.0:
type: composer
version: 3.4.11
5.6:
type: composer
version: 3.4.11
5.5:
type: composer
version: 3.4.11
php-cs-fixer:
disabled: [5.2, 8.2]
check: php-cs-fixer --version 2>&1 | grep -E 'Fixer\s+(version\s*)?[-_.0-9]+\s+' || (php-cs-fixer --version; false)
all:
type: custom
command: curl -sS -k -L --fail -L "${PHP_CS_FIXER_URL}" -o /usr/local/bin/php-cs-fixer
pre: PHP_CS_FIXER_URL="https://cs.symfony.com/download/php-cs-fixer-v3.phar"
post: chmod +x /usr/local/bin/php-cs-fixer
7.3:
type: custom
pre: PHP_CS_FIXER_URL="https://cs.symfony.com/download/php-cs-fixer-v2.phar"
7.2:
type: custom
pre: PHP_CS_FIXER_URL="https://cs.symfony.com/download/php-cs-fixer-v2.phar"
7.1:
type: custom
pre: PHP_CS_FIXER_URL="https://cs.symfony.com/download/php-cs-fixer-v2.phar"
7.0:
type: custom
pre: PHP_CS_FIXER_URL="https://cs.symfony.com/download/php-cs-fixer-v2.phar"
5.6:
type: custom
pre: PHP_CS_FIXER_URL="https://cs.symfony.com/download/php-cs-fixer-v2.phar"
5.5:
type: custom
pre: PHP_CS_FIXER_URL="https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.2.19/php-cs-fixer.phar"
5.4:
type: custom
pre: PHP_CS_FIXER_URL="https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.2.19/php-cs-fixer.phar"
5.3:
type: custom
pre: PHP_CS_FIXER_URL="https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.2.19/php-cs-fixer.phar"
phpcbf:
disabled: []
check: phpcbf --version | grep -E 'version [0-9][.0-9]+' || (phpcbf --version; false)
all:
type: custom
command: curl -sS -k -L --fail -L "${PHPCBF_URL}" -o /usr/local/bin/phpcbf
pre: PHPCBF_URL="https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar"
post: chmod +x /usr/local/bin/phpcbf
5.3:
type: custom
pre: PHPCBF_URL="https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.0/phpcbf.phar"
5.2:
type: custom
pre: PHPCBF_URL="https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.0/phpcbf.phar"
phpcs:
disabled: []
check: phpcs --version | grep -E 'version [0-9][.0-9]+' || (phpcs --version; false)
all:
type: custom
command: curl -sS -k -L --fail -L "${PHPCS_URL}" -o /usr/local/bin/phpcs
pre: PHPCS_URL="https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar"
post: chmod +x /usr/local/bin/phpcs
5.3:
type: custom
pre: PHPCS_URL="https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.0/phpcs.phar"
5.2:
type: custom
pre: PHPCS_URL="https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.0/phpcs.phar"
phpmd:
disabled: [5.2]
check: phpmd --version | grep -E '^PHPMD [0-9][.0-9]+' || (phpmd --version; false)
all:
type: custom
command: curl -sS -k -L --fail https://phpmd.org/static/latest/phpmd.phar -L -o /usr/local/bin/phpmd
post: chmod +x /usr/local/bin/phpmd
phpunit:
disabled: [5.2]
check: phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false)
all:
type: custom
command: |
if [ -n "${PHP_UNIT_VERSION}" ]; then \
PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \
else \
PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \
fi \
&& curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \
build_dep: []
run_dep: []
pre: PHP_UNIT_VERSION=""
post: chmod +x /usr/local/bin/phpunit
7.2:
type: custom
pre: PHP_UNIT_VERSION="8"
7.1:
type: custom
pre: PHP_UNIT_VERSION="7"
7.0:
type: custom
pre: PHP_UNIT_VERSION="6"
5.6:
type: custom
pre: PHP_UNIT_VERSION="5"
5.5:
type: custom
pre: PHP_UNIT_VERSION="4"
5.4:
type: custom
pre: PHP_UNIT_VERSION="4"
5.3:
type: custom
pre: PHP_UNIT_VERSION="4"
pm2:
disabled: []
check: pm2 --no-daemon --version | tail -1 | grep -E '[0-9][.0-9]+' || (pm2 --no-daemon --version; false)
all:
type: npm
package: pm2
binary: pm2
version:
build_dep: []
run_dep: []
pre:
post:
pwncat:
disabled: []
check: pwncat --version 2>&1 | grep -E 'Version [0-9][.0-9]+' || (pwncat --version; false)
all:
type: pip
version:
build_dep: []
run_dep: []
pre:
post: |
ln -s pwncat /usr/local/bin/netcat \
ssh:
disabled: []
check: ssh -V 2>&1 | grep ^OpenSSH || (ssh -V; false)
all:
type: apt
package: openssh-client
rsync:
disabled: []
check: rsync --version | grep version | grep -E '[0-9]\.[0-9]+' || (rsync --version; false)
all:
type: apt
package: rsync
sass:
disabled: []
check: sass --version | grep -E '[0-9][.0-9]+' || (sass --version; false)
all:
type: npm
package: sass
binary: sass
version:
build_dep: []
run_dep: []
pre:
post:
shellcheck:
disabled: []
check: shellcheck --version | grep -E '[0-9][.0-9]+' || (shellcheck --version; false)
all:
type: apt
package: shellcheck
stylelint:
disabled: []
check: stylelint --version | grep -E '[0-9][.0-9]+' || (stylelint --version; false)
all:
type: npm
package: stylelint
binary: stylelint
version:
build_dep: []
run_dep: []
pre:
post:
svn:
disabled: []
check: svn --version | grep version | grep -E '[0-9]+\.[0-9]+' || (svn --version; false)
all:
type: apt
package: subversion
symfony-cli:
disabled: []
check: symfony --no-ansi -V | grep -E 'version [0-9][.0-9]+' || (symfony --no-ansi -V; false)
all:
type: custom
command: curl -sS https://get.symfony.com/cli/installer | bash -s -- --install-dir /usr/local/bin
build_dep: []
run_dep: []
taskfile:
disabled: []
check: task --version | grep -E '[0-9][.0-9]+' || (task --version; false)
all:
type: custom
command: sh -c "$(curl -sS -K --fail -k https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin/
tig:
disabled: []
check: tig --version 2>&1 | grep -E '[0-9][.0-9]+' || (tig --version; false)
all:
type: apt
package: tig
vim:
disabled: []
check: vim --version | grep ^VIM | grep -E '[0-9]\.[0-9]+' || (vim --version; false)
all:
type: apt
package: vim
vue-cli:
disabled: []
check: vue --version | grep -E '[0-9][.0-9]+' || (vue --version; false)
all:
type: npm
package: "@vue/cli"
binary: vue
version:
build_dep: []
run_dep: []
pre:
post:
webpack-cli:
disabled: []
check: webpack-cli --version | grep -E '[0-9][.0-9]+' || (webpack-cli --version; false)
all:
type: npm
package: webpack-cli
binary: webpack-cli
version:
build_dep: []
run_dep: []
pre:
post:
wkhtmltopdf:
disabled: [5.2, 5.3, 5.4, 5.5]
check: wkhtmltopdf --version | grep ^wkhtmltopdf | grep -E '[0-9]\.[0-9]+' | grep patched || (wkhtmltopdf --version; false)
all:
type: custom
pre: OS_RELEASE="bullseye"
command: |
DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& WK_URL="$( \
curl -sSL -L --fail https://api.github.com/repos/wkhtmltopdf/packaging/releases \
| awk -F\" "/wkhtmltopdf.*.${OS_RELEASE}_${DEB_HOST_ARCH}\.deb/{print \$(NF-1)}" \
| head -1 \
)" \
&& echo "URL: ${WK_URL}" \
&& curl -sS -L --fail -o /tmp/wkhtmltopdf.deb "${WK_URL}" \
&& dpkg -i /tmp/wkhtmltopdf.deb \
&& rm -f /tmp/wkhtmltopdf.deb \
run_dep:
- fontconfig
- libfontenc1
- libxfont2
- libxrender1
- xfonts-75dpi
- xfonts-base
- xfonts-encodings
- xfonts-utils
7.2:
type: custom
pre: OS_RELEASE="buster"
7.1:
type: custom
pre: OS_RELEASE="buster"
7.0:
type: custom
pre: OS_RELEASE="stretch"
run_dep:
- fontconfig
- libfontenc1
- libxfont1
- libxrender1
- xfonts-75dpi
- xfonts-base
- xfonts-encodings
- xfonts-utils
5.6:
type: custom
pre: OS_RELEASE="stretch"
run_dep:
- fontconfig
- libfontenc1
- libxfont1
- libxrender1
- xfonts-75dpi
- xfonts-base
- xfonts-encodings
- xfonts-utils
wp-cli:
disabled: [5.2]
check: wp --allow-root --version | grep -E '[0-9][.0-9]+' || (wp --allow-root --version; false)
all:
type: custom
command: curl -sS -L --fail "${WPCLI_URL}" -L -o /usr/local/bin/wp
build_dep: []
run_dep: []
pre: WPCLI_URL="https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar"
post: chmod +x /usr/local/bin/wp
5.5:
type: custom
pre: WPCLI_URL="https://github.com/wp-cli/wp-cli/releases/download/v2.4.0/wp-cli-2.4.0.phar"
5.4:
type: custom
pre: WPCLI_URL="https://github.com/wp-cli/wp-cli/releases/download/v2.4.0/wp-cli-2.4.0.phar"
5.3:
type: custom
pre: WPCLI_URL="https://github.com/wp-cli/wp-cli/releases/download/v1.5.1/wp-cli-1.5.1.phar"
yamllint:
disabled: []
check: yamllint --version 2>&1 | grep -E '[0-9][.0-9]+' || (yamllint --version; false)
all:
type: pip
version:
build_dep: []
run_dep: []
# pre:
# post:
yq:
disabled: []
check: yq --version 2>&1 | grep -E '[0-9][.0-9]+' || (yq --version; false)
all:
type: pip
version:
build_dep: []
run_dep: []
pre:
post:
zsh:
disabled: []
check: zsh --version 2>&1 | grep -E '[0-9][.0-9]+' || (zsh --version; false)
all:
type: apt
package: zsh

View File

@@ -10,3 +10,5 @@ php-7.2 php_version=7.2 ansible_connection=local
php-7.3 php_version=7.3 ansible_connection=local php-7.3 php_version=7.3 ansible_connection=local
php-7.4 php_version=7.4 ansible_connection=local php-7.4 php_version=7.4 ansible_connection=local
php-8.0 php_version=8.0 ansible_connection=local php-8.0 php_version=8.0 ansible_connection=local
php-8.1 php_version=8.1 ansible_connection=local
php-8.2 php_version=8.2 ansible_connection=local

View File

@@ -0,0 +1,283 @@
{##################################################################################################
# IMPORTS
##################################################################################################}
{% import './jinja2/macros.j2' as fn %}
{##################################################################################################
# GENERIC MACROS
##################################################################################################}
{#-
###
### Check if not disabled
###
### Returns 'true' string if not disabled, otherwise returns nothing
###
-#}
{%- macro is_not_disabled(php, name, items) -%}
{%- if ('disabled' not in items[name]) or (php not in items[name]['disabled']) -%}
{{- 'true' -}}
{%- endif -%}
{%- endmacro -%}
{#-
###
### Get 'type'
###
### Returns type string
###
-#}
{%- macro get_type(php, name, items) -%}
{{- fn.get_val(php, name, items, 'type', '<WRONG TYPE>') -}}
{%- endmacro -%}
{#-
###
### Get 'pre'
###
### Returns pre string
###
-#}
{%- macro get_pre(php, name, items) -%}
{{- fn.get_val(php, name, items, 'pre', '') -}}
{%- endmacro -%}
{#-
###
### Get 'post'
###
### Returns post string
###
-#}
{%- macro get_post(php, name, items) -%}
{{- fn.get_val(php, name, items, 'post', '') -}}
{%- endmacro -%}
{#-
###
### Get 'build_dep'
###
### Returns json string (jsonified list) of build_dep (use '| to_json' to eval)
###
-#}
{%- macro get_build_dep(php, name, items) -%}
{{- fn.get_list_if_enabled(php, name, items, 'build_dep') -}}
{%- endmacro -%}
{#-
###
### Get 'run_dep'
###
### Returns json string (jsonified list) of run_dep (use '| to_json' to eval)
###
-#}
{%- macro get_run_dep(php, name, items) -%}
{{- fn.get_list_if_enabled(php, name, items, 'run_dep') -}}
{%- endmacro -%}
{##################################################################################################
# TOOLS SPECIFIC MACROS
##################################################################################################}
{# --------------------------------------------- REPO ----------------------------------------- -#}
{#-
###
### Get 'deb'
### type: repo
###
-#}
{%- macro tool_repo_get_deb(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'deb', 'repo', '') -}}
{%- endmacro -%}
{#-
###
### Get 'key'
### type: repo
###
-#}
{%- macro tool_repo_get_key(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'key', 'repo', '') -}}
{%- endmacro -%}
{# --------------------------------------------- CUSTOM --------------------------------------- -#}
{#-
###
### Get 'command'
### type: custom
###
-#}
{%- macro tool_custom_get_command(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'command', 'custom', '') -}}
{%- endmacro -%}
{# --------------------------------------------- NPM ------------------------------------------ -#}
{#-
###
### Get 'package'
### type: npm
###
-#}
{%- macro tool_npm_get_package(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'package', 'npm', name) -}}
{%- endmacro -%}
{#-
###
### Get 'version'
### type: npm
###
-#}
{%- macro tool_npm_get_version(php, name, items) -%}
{%- set version = fn.get_val_by_type(php, name, items, 'version', 'npm', '') -%}
{%- if version | length -%}
{{- '@' ~ version -}}
{%- else -%}
{{- '' -}}
{%- endif -%}
{%- endmacro -%}
{#-
###
### Get 'binary'
### type: npm
###
-#}
{%- macro tool_npm_get_binary(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'binary', 'npm', '') -}}
{%- endmacro -%}
{# --------------------------------------------- COMPOSER ------------------------------------- -#}
{#-
###
### Get 'composer'
### type: composer
###
-#}
{%- macro tool_composer_get_composer(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'composer', 'composer', '') -}}
{%- endmacro -%}
{#-
###
### Get 'package'
### type: composer
###
-#}
{%- macro tool_composer_get_package(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'package', 'composer', '') -}}
{%- endmacro -%}
{#-
###
### Get 'version'
### type: composer
###
-#}
{%- macro tool_composer_get_version(php, name, items) -%}
{%- set version = fn.get_val_by_type(php, name, items, 'version', 'composer', '') -%}
{%- if version | length -%}
{{- ':' ~ version -}}
{%- else -%}
{{- '' -}}
{%- endif -%}
{%- endmacro -%}
{#-
###
### Get 'flags'
### type: composer
###
-#}
{%- macro tool_composer_get_flags(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'flags', 'composer', '') -}}
{%- endmacro -%}
{#-
###
### Get 'binary'
### type: composer
###
-#}
{%- macro tool_composer_get_binary(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'binary', 'composer', '') -}}
{%- endmacro -%}
{# --------------------------------------------- RUBYGEM -------------------------------------- -#}
{#-
###
### Get 'package'
### type: rubygem
###
-#}
{%- macro tool_rubygem_get_package(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'package', 'rubygem', '') -}}
{%- endmacro -%}
{#-
###
### Get 'version'
### type: rubygem
###
-#}
{%- macro tool_rubygem_get_version(php, name, items) -%}
{%- set version = fn.get_val_by_type(php, name, items, 'version', 'rubygem', '') -%}
{%- if version | length -%}
{{- ' -v ' ~ version -}}
{%- else -%}
{{- '' -}}
{%- endif -%}
{%- endmacro -%}
{# --------------------------------------------- PIP ------------------------------------------ -#}
{#-
###
### Get 'package'
### type: pip
###
-#}
{%- macro tool_pip_get_package(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'package', 'pip', name) -}}
{%- endmacro -%}
{#-
###
### Get 'version'
### type: pip
###
-#}
{%- macro tool_pip_get_version(php, name, items) -%}
{%- set version = fn.get_val_by_type(php, name, items, 'version', 'pip', '') -%}
{%- if version | length -%}
{{- '==' ~ version -}}
{%- else -%}
{{- '' -}}
{%- endif -%}
{%- endmacro -%}
{# --------------------------------------------- APT ------------------------------------------ -#}
{#-
###
### Get 'package'
### type: apt
###
-#}
{%- macro tool_apt_get_package(php, name, items) -%}
{%- if is_not_disabled(php, name, items) -%}
{{- fn.get_val_by_type(php, name, items, 'package', 'apt', '') -}}
{%- endif -%}
{%- endmacro -%}

90
.ansible/jinja2/macros.j2 Normal file
View File

@@ -0,0 +1,90 @@
{##################################################################################################
# HELPER MACROS
##################################################################################################}
{#
### Get generic string value of key if type value matches.
###
### php: The PHP Version
### name: The item name
### items: The items_available list
### key: The key to retrieve the value for
### type: The type key must match this type string
### default: Default value to return if none was found
#}
{%- macro get_val_by_type(php, name, items, key, type, default='' ) -%}
{#- Default return value -#}
{%- set result = default -%}
{#- PHP Version specific -#}
{%- if php in items[name] and items[name][php]['type'] == type -%}
{%- if key in items[name][php] and items[name][php][key] -%}
{%- set result = items[name][php][key] -%}
{%- elif key in items[name]['all'] and items[name]['all'][key] -%}
{%- set result = items[name]['all'][key] -%}
{%- endif -%}
{#- Defined in 'all' -#}
{%- elif 'all' in items[name] and items[name]['all']['type'] == type -%}
{%- if key in items[name]['all'] and items[name]['all'][key] -%}
{%- set result = items[name]['all'][key] -%}
{%- endif -%}
{%- endif -%}
{{- result -}}
{%- endmacro -%}
{#-
### Get generic string value of key.
###
### php: The PHP Version
### name: The item name
### items: The items_available list
### key: The key to retrieve the value for
### default: Default value to return if none was found
-#}
{%- macro get_val(php, name, items, key, default='') -%}
{%- if php in items[name] and key in items[name][php] and items[name][php][key] -%}
{{- items[name][php][key] -}}
{%- elif 'all' in items[name] and key in items[name]['all'] and items[name]['all'][key] -%}
{{- items[name]['all'][key] -}}
{%- else -%}
{{- default -}}
{%- endif -%}
{%- endmacro -%}
{#-
### Get generic list value (space separated) of not disabled PHP versions.
###
### Returns jsonified string of a list.
###
### Usage:
### {%- set list = [] -%}
### {%- for val in get_enabled_list(php_version, item, items_available) | from_json -%}
### {%- if val -%}
### {{- list.append(val) -}}
### {%- endif -%}
### {%- endfor -%}
###
### php: The PHP Version
### name: The item name
### items: The items_available list
### key: The key to retrieve the value for
-#}
{%- macro get_list_if_enabled(php, name, items, key) -%}
{%- set list = [] %}
{# Not disabled #}
{%- if ('disabled' not in items[name]) or (php not in items[name]['disabled']) -%}
{#- Version specific build dependency available? -#}
{%- if php in items[name] and key in items[name][php] -%}
{%- for val in items[name][php][key] -%}
{{- list.append(val) -}}
{%- endfor -%}
{#- Generic build dependency available? -#}
{%- elif 'all' in items[name] and key in items[name]['all'] -%}
{%- for val in items[name]['all'][key] -%}
{{- list.append(val) -}}
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{{- list | to_json -}}
{%- endmacro -%}

View File

@@ -1,7 +1,7 @@
--- ---
- name: generate Dockerfiles - name: generate Dockerfiles
template: ansible.builtin.template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dst }}" dest: "{{ item.dst }}"
force: True force: True
@@ -10,7 +10,7 @@
- "{{ template_dockerfiles }}" - "{{ template_dockerfiles }}"
- name: generate php configuration files - name: generate php configuration files
template: ansible.builtin.template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dst }}" dest: "{{ item.dst }}"
force: True force: True

3
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
---
github: [cytopia]
patreon: devilbox

View File

@@ -0,0 +1,365 @@
---
# -------------------------------------------------------------------------------------------------
# Job Name
# -------------------------------------------------------------------------------------------------
name: nightly
# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
on:
# Nightly: At 00:00 on Monday, Wednesday, and Friday
schedule:
- cron: '0 18 * * 1,3,5'
# Dispatch: allows for manual trigger via GH UI
workflow_dispatch:
jobs:
# -----------------------------------------------------------------------------------------------
# (1/9) Determine parameter settings
# -----------------------------------------------------------------------------------------------
params:
uses: ./.github/workflows/params-nightly_master.yml
# -----------------------------------------------------------------------------------------------
# (2/9) Configure Build and Deploy Matrices
# -----------------------------------------------------------------------------------------------
configure:
needs: [params]
uses: devilbox/github-actions/.github/workflows/docker-multistage-configure.yml@master
with:
enabled: true
can_deploy: true
versions: ${{ needs.params.outputs.versions }}
refs: ${{ needs.params.outputs.refs }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
# -----------------------------------------------------------------------------------------------
# (3/9) Build & Test base
# -----------------------------------------------------------------------------------------------
build-base:
needs:
- configure
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
pull_base_image: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: base
stage_prev: ''
test-base:
needs:
- configure
- build-base
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: base
# -----------------------------------------------------------------------------------------------
# (4/9) Build & Test mods
# -----------------------------------------------------------------------------------------------
build-mods:
needs:
- configure
- build-base
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: mods
stage_prev: base
test-mods:
needs:
- configure
- build-mods
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: mods
# -----------------------------------------------------------------------------------------------
# (5/9) Build & Test prod
# -----------------------------------------------------------------------------------------------
build-prod:
needs:
- configure
- build-mods
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: prod
stage_prev: mods
test-prod:
needs:
- configure
- build-prod
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: prod
# -----------------------------------------------------------------------------------------------
# (6/9) Build & Test slim
# -----------------------------------------------------------------------------------------------
build-slim:
needs:
- configure
- build-prod
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: slim
stage_prev: prod
test-slim:
needs:
- configure
- build-slim
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: slim
# -----------------------------------------------------------------------------------------------
# (7/9) Build & Test work
# -----------------------------------------------------------------------------------------------
build-work:
needs:
- configure
- build-slim
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: work
stage_prev: slim
test-work:
needs:
- configure
- build-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: work
# -----------------------------------------------------------------------------------------------
# (8/9) Push images
# -----------------------------------------------------------------------------------------------
push-base:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: base
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-mods:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: mods
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-prod:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: prod
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-slim:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: slim
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-work:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: work
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
# -----------------------------------------------------------------------------------------------
# (9/9) Push Manifests
# -----------------------------------------------------------------------------------------------
manifest-base:
needs:
- configure
- push-base
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: base
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-mods:
needs:
- configure
- push-mods
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: mods
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-prod:
needs:
- configure
- push-prod
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: prod
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-slim:
needs:
- configure
- push-slim
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: slim
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-work:
needs:
- configure
- push-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: work
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}

View File

@@ -0,0 +1,365 @@
---
# -------------------------------------------------------------------------------------------------
# Job Name
# -------------------------------------------------------------------------------------------------
name: nightly
# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
on:
# Nightly: At 18:00 on Sunday, Tuesday, and Thursday
schedule:
- cron: '0 18 * * 0,2,4'
# Dispatch: allows for manual trigger via GH UI
workflow_dispatch:
jobs:
# -----------------------------------------------------------------------------------------------
# (1/9) Determine parameter settings
# -----------------------------------------------------------------------------------------------
params:
uses: ./.github/workflows/params-nightly_tags.yml
# -----------------------------------------------------------------------------------------------
# (2/9) Configure Build and Deploy Matrices
# -----------------------------------------------------------------------------------------------
configure:
needs: [params]
uses: devilbox/github-actions/.github/workflows/docker-multistage-configure.yml@master
with:
enabled: true
can_deploy: true
versions: ${{ needs.params.outputs.versions }}
refs: ${{ needs.params.outputs.refs }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
# -----------------------------------------------------------------------------------------------
# (3/9) Build & Test base
# -----------------------------------------------------------------------------------------------
build-base:
needs:
- configure
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
pull_base_image: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: base
stage_prev: ''
test-base:
needs:
- configure
- build-base
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: base
# -----------------------------------------------------------------------------------------------
# (4/9) Build & Test mods
# -----------------------------------------------------------------------------------------------
build-mods:
needs:
- configure
- build-base
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: mods
stage_prev: base
test-mods:
needs:
- configure
- build-mods
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: mods
# -----------------------------------------------------------------------------------------------
# (5/9) Build & Test prod
# -----------------------------------------------------------------------------------------------
build-prod:
needs:
- configure
- build-mods
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: prod
stage_prev: mods
test-prod:
needs:
- configure
- build-prod
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: prod
# -----------------------------------------------------------------------------------------------
# (6/9) Build & Test slim
# -----------------------------------------------------------------------------------------------
build-slim:
needs:
- configure
- build-prod
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: slim
stage_prev: prod
test-slim:
needs:
- configure
- build-slim
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: slim
# -----------------------------------------------------------------------------------------------
# (7/9) Build & Test work
# -----------------------------------------------------------------------------------------------
build-work:
needs:
- configure
- build-slim
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: work
stage_prev: slim
test-work:
needs:
- configure
- build-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: work
# -----------------------------------------------------------------------------------------------
# (8/9) Push images
# -----------------------------------------------------------------------------------------------
push-base:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: base
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-mods:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: mods
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-prod:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: prod
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-slim:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: slim
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-work:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: work
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
# -----------------------------------------------------------------------------------------------
# (9/9) Push Manifests
# -----------------------------------------------------------------------------------------------
manifest-base:
needs:
- configure
- push-base
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: base
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-mods:
needs:
- configure
- push-mods
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: mods
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-prod:
needs:
- configure
- push-prod
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: prod
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-slim:
needs:
- configure
- push-slim
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: slim
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-work:
needs:
- configure
- push-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: work
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}

387
.github/workflows/action.yml vendored Normal file
View File

@@ -0,0 +1,387 @@
---
# -------------------------------------------------------------------------------------------------
# Job Name
# -------------------------------------------------------------------------------------------------
name: build
# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
on:
# Push or pull_request will be determined in jobs.configure.enabled
push:
paths:
- '.ansible/**'
- '.github/workflows/action.yml'
- '.github/workflows/params.yml'
- 'Dockerfiles/**'
- 'php_modules/**'
- 'php_tools/**'
- 'tests/**'
- 'Makefile'
- '!**.md'
- '!.ansible/ansible.cfg'
pull_request:
paths:
- '.ansible/**'
- '.github/workflows/action.yml'
- '.github/workflows/params.yml'
- 'Dockerfiles/**'
- 'php_modules/**'
- 'php_tools/**'
- 'tests/**'
- 'Makefile'
- '!**.md'
- '!.ansible/ansible.cfg'
# Dispatch: allows for manual trigger via GH UI
workflow_dispatch:
jobs:
# -----------------------------------------------------------------------------------------------
# (1/9) Determine parameter settings
# -----------------------------------------------------------------------------------------------
params:
uses: ./.github/workflows/params.yml
# -----------------------------------------------------------------------------------------------
# (2/9) Configure Build and Deploy Matrices
# -----------------------------------------------------------------------------------------------
configure:
needs: [params]
uses: devilbox/github-actions/.github/workflows/docker-multistage-configure.yml@master
with:
enabled: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && (github.event.pull_request.user.login != 'cytopia')) }}
can_deploy: ${{ (github.repository == 'devilbox/docker-php-fpm') && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-')) }}
versions: ${{ needs.params.outputs.versions }}
refs: ${{ needs.params.outputs.refs }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
# -----------------------------------------------------------------------------------------------
# (3/9) Build & Test base
# -----------------------------------------------------------------------------------------------
build-base:
needs:
- configure
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
pull_base_image: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: base
stage_prev: ''
test-base:
needs:
- configure
- build-base
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: base
# -----------------------------------------------------------------------------------------------
# (4/9) Build & Test mods
# -----------------------------------------------------------------------------------------------
build-mods:
needs:
- configure
- build-base
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: mods
stage_prev: base
test-mods:
needs:
- configure
- build-mods
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: mods
# -----------------------------------------------------------------------------------------------
# (5/9) Build & Test prod
# -----------------------------------------------------------------------------------------------
build-prod:
needs:
- configure
- build-mods
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: prod
stage_prev: mods
test-prod:
needs:
- configure
- build-prod
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: prod
# -----------------------------------------------------------------------------------------------
# (6/9) Build & Test slim
# -----------------------------------------------------------------------------------------------
build-slim:
needs:
- configure
- build-prod
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: slim
stage_prev: prod
test-slim:
needs:
- configure
- build-slim
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: slim
# -----------------------------------------------------------------------------------------------
# (7/9) Build & Test work
# -----------------------------------------------------------------------------------------------
build-work:
needs:
- configure
- build-slim
uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
run_tests: false
upload_artifact: true
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: work
stage_prev: slim
test-work:
needs:
- configure
- build-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master
with:
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: work
# -----------------------------------------------------------------------------------------------
# (8/9) Push images
# -----------------------------------------------------------------------------------------------
push-base:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: base
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-mods:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: mods
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-prod:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: prod
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-slim:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: slim
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
push-work:
needs:
- configure
- test-base
- test-mods
- test-prod
- test-slim
- test-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_build }}
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
stage: work
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
# -----------------------------------------------------------------------------------------------
# (9/9) Push Manifests
# -----------------------------------------------------------------------------------------------
manifest-base:
needs:
- configure
- push-base
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: base
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-mods:
needs:
- configure
- push-mods
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: mods
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-prod:
needs:
- configure
- push-prod
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: prod
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-slim:
needs:
- configure
- push-slim
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: slim
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
manifest-work:
needs:
- configure
- push-work
uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master
with:
can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }}
has_refs: ${{ needs.configure.outputs.has_refs == 'true' }}
matrix: ${{ needs.configure.outputs.matrix_deploy }}
versions: ${{ needs.configure.outputs.versions }}
stage: work
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}

62
.github/workflows/linting.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
---
# -------------------------------------------------------------------------------------------------
# Job Name
# -------------------------------------------------------------------------------------------------
name: lint
# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
on:
# Runs on Pull Requests
workflow_dispatch:
pull_request:
# -------------------------------------------------------------------------------------------------
# What to run
# -------------------------------------------------------------------------------------------------
jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
steps:
# ------------------------------------------------------------
# Setup repository
# ------------------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install required Python packages
run: |
pip install yamllib
pip install typing
# ------------------------------------------------------------
# Lint repository
# ------------------------------------------------------------
- name: Lint Files
run: |
make lint-files
- name: Lint Yaml
run: |
make lint-yaml
- name: Lint Changelog
run: |
make lint-changelog
- name: Diff generated Docker files
run: |
make gen-dockerfiles
git diff --quiet || { echo "Build Changes"; git diff; git status; false; }

View File

@@ -0,0 +1,71 @@
---
# -------------------------------------------------------------------------------------------------
# Job Name
# -------------------------------------------------------------------------------------------------
name: params
# -------------------------------------------------------------------------------------------------
# Custom Variables
# -------------------------------------------------------------------------------------------------
env:
VERSIONS: >
[
{
"NAME": "PHP",
"VERSION": ["5.2"],
"FLAVOUR": ["default"],
"ARCH": ["linux/amd64"]
},
{
"NAME": "PHP",
"VERSION": ["5.3", "5.4", "5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"],
"FLAVOUR": ["default"],
"ARCH": ["linux/amd64", "linux/arm64"]
}
]
REFS: >
{
"DEFAULT_BRANCH": "master",
"BRANCHES": "master",
"NUM_LATEST_TAGS": 0
}
# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
on:
workflow_call:
###
### OUTPUTS
###
outputs:
versions:
description: "JSON string for versions. Use via: fromJson(needs.params.versions)"
value: ${{ jobs.params.outputs.versions }}
refs:
description: "JSON string for refs. Use via: fromJson(needs.params.refs)"
value: ${{ jobs.params.outputs.refs }}
jobs:
params:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.set-versions.outputs.versions }}
refs: ${{ steps.set-refs.outputs.refs }}
steps:
- name: "[Set-Output] jsonify VERSIONS"
id: set-versions
run: |
VERSIONS="$( echo '${{ env.VERSIONS }}' | jq -M -c )"
echo "versions=${VERSIONS}" >> $GITHUB_OUTPUT
- name: "[Set-Output] jsonify REFS"
id: set-refs
run: |
REFS="$( echo '${{ env.REFS }}' | jq -M -c )"
echo "refs=${REFS}" >> $GITHUB_OUTPUT

View File

@@ -0,0 +1,71 @@
---
# -------------------------------------------------------------------------------------------------
# Job Name
# -------------------------------------------------------------------------------------------------
name: params
# -------------------------------------------------------------------------------------------------
# Custom Variables
# -------------------------------------------------------------------------------------------------
env:
VERSIONS: >
[
{
"NAME": "PHP",
"VERSION": ["5.2"],
"FLAVOUR": ["default"],
"ARCH": ["linux/amd64"]
},
{
"NAME": "PHP",
"VERSION": ["5.3", "5.4", "5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"],
"FLAVOUR": ["default"],
"ARCH": ["linux/amd64", "linux/arm64"]
}
]
REFS: >
{
"DEFAULT_BRANCH": "master",
"BRANCHES": "",
"NUM_LATEST_TAGS": 1
}
# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
on:
workflow_call:
###
### OUTPUTS
###
outputs:
versions:
description: "JSON string for versions. Use via: fromJson(needs.params.versions)"
value: ${{ jobs.params.outputs.versions }}
refs:
description: "JSON string for refs. Use via: fromJson(needs.params.refs)"
value: ${{ jobs.params.outputs.refs }}
jobs:
params:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.set-versions.outputs.versions }}
refs: ${{ steps.set-refs.outputs.refs }}
steps:
- name: "[Set-Output] jsonify VERSIONS"
id: set-versions
run: |
VERSIONS="$( echo '${{ env.VERSIONS }}' | jq -M -c )"
echo "versions=${VERSIONS}" >> $GITHUB_OUTPUT
- name: "[Set-Output] jsonify REFS"
id: set-refs
run: |
REFS="$( echo '${{ env.REFS }}' | jq -M -c )"
echo "refs=${REFS}" >> $GITHUB_OUTPUT

71
.github/workflows/params.yml vendored Normal file
View File

@@ -0,0 +1,71 @@
---
# -------------------------------------------------------------------------------------------------
# Job Name
# -------------------------------------------------------------------------------------------------
name: params
# -------------------------------------------------------------------------------------------------
# Custom Variables
# -------------------------------------------------------------------------------------------------
env:
VERSIONS: >
[
{
"NAME": "PHP",
"VERSION": ["5.2"],
"FLAVOUR": ["default"],
"ARCH": ["linux/amd64"]
},
{
"NAME": "PHP",
"VERSION": ["5.3", "5.4", "5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"],
"FLAVOUR": ["default"],
"ARCH": ["linux/amd64", "linux/arm64"]
}
]
REFS: >
{
"DEFAULT_BRANCH": "master",
"BRANCHES": "",
"NUM_LATEST_TAGS": 0
}
# -------------------------------------------------------------------------------------------------
# When to run
# -------------------------------------------------------------------------------------------------
on:
workflow_call:
###
### OUTPUTS
###
outputs:
versions:
description: "JSON string for versions. Use via: fromJson(needs.params.versions)"
value: ${{ jobs.params.outputs.versions }}
refs:
description: "JSON string for refs. Use via: fromJson(needs.params.refs)"
value: ${{ jobs.params.outputs.refs }}
jobs:
params:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.set-versions.outputs.versions }}
refs: ${{ steps.set-refs.outputs.refs }}
steps:
- name: "[Set-Output] jsonify VERSIONS"
id: set-versions
run: |
VERSIONS="$( echo '${{ env.VERSIONS }}' | jq -M -c )"
echo "versions=${VERSIONS}" >> $GITHUB_OUTPUT
- name: "[Set-Output] jsonify REFS"
id: set-refs
run: |
REFS="$( echo '${{ env.REFS }}' | jq -M -c )"
echo "refs=${REFS}" >> $GITHUB_OUTPUT

77
.gitignore vendored
View File

@@ -1,74 +1,5 @@
###################################### .ansible/*.retry
# CUSTOM
######################################
build/ansible/*.retry Makefile.docker
Makefile.lint
Makefile.python
######################################
# GENERIC
######################################
###### std ######
.lock
*.log
###### patches/diffs ######
*.patch
*.diff
*.orig
*.rej
######################################
# Operating Systems
######################################
###### OSX ######
._*
.DS*
.Spotlight-V100
.Trashes
###### Windows ######
Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
*.lnk
######################################
# Editors
######################################
###### Sublime ######
*.sublime-workspace
*.sublime-project
###### Eclipse ######
.classpath
.buildpath
.project
.settings/
###### Netbeans ######
nbproject/private/
###### Intellij IDE ######
.idea/
.idea_modules/
###### vim ######
*.swp
*.swo
*~
###### TextMate ######
.tm_properties
*.tmproj
###### BBEdit ######
*.bbprojectd
*.bbproject

View File

@@ -1,144 +0,0 @@
---
###
### Travis settings
###
sudo: required
language: python
services:
- docker
###
### Build Matrix
###
env:
global:
- IMAGE: devilbox/php-fpm
# travis encrypt DOCKER_USERNAME=user
# travis encrypt DOCKER_PASSWORD=pass
# Must be regenerated when repository name/owner changes
# DOCKER_USERNAME
- secure: "Y7xt3qZW9Zwrsgdd/aCf8ZqA7I039506ZDf/u/WVzGwNHta5YJJ7XYy8XG7XugyqGGXRVpfBiaqmDH4xsPLXyHXdOt2G38GXZHZXIgJOiEJ6aUfpdUxyeu8XIXkD2MDMmc3Kb27Yub/OadxRMLWEflzRnSXXs3KJ8TsbPHh0yRWDMsmHYOYl16gDGUX1izLkEx4J+9iA3+JwIFZk8by/OUuIIQ93bSNORpwHT8A1j7Y1kh8kYkPZ6nRxWO8xrc2wI1Rbp0X+ivLnOotxDZo53UI/0KroeSckDpoWfoz+B7mP+M+5B6kGlI2pKDNQB/ErYvnya6PdtFSS9skbvepR4tBhUOZDDY7NMRg9m3w0b9T1no+g3A4LBGXy6+OZZoiYAGy9LvqMhFkINqbBhRBX+mZhtG0pNXunfcu5dk81Ni/XpXDiy9JU98jItwsRj4SeaPfSt0LUNNXMS/fEwZyTy6TihN1CM3krJpV30Ic5rN64FRnrRjUuNU4lJ/W36yUhM29gb13ahh+f7sDsYoCzMwDM9HFe0YLb3ar3mW1lb3FuUugU2f2EupgCPY60X2XrY9aSgCfbdiVsA84dbLtRfHTPG7UbEcJW5RH8HS+9qVZBK+AcPqon9jbOJRVh7q99YW+R8X/XeyYpz7amacVmRus80+toZ16bbU7D2Qgjdek="
# DOCKER_PASSWORD
- secure: "ZRrVOVOkSCS2UxEi1HNF1iKefK4sDT/sPRl1HxMQjLnRRaAMdG0aRnBwQf2YAM2qzhCfN85qt6zZtC4awc2mHiZ88JrAZxBjK6xj4BwOyLbDuzpBsKXnx8Nix+wyYYKSjsC3LOYrsUe+4rvkw3tVvVaX8G2llojwdksF34VDmmHBmzCG/Bsexk7UqC+qw0PZm7BtctQO+IL0btmMDijRDElxfR+AuPvf9JdkhYzw9TOO7Jqd53NssNVGyL+XSV0dfGn8PkZTp1e8D+28pLK4oGVog+Wk7Cq94hSGjk5AkWKvL5441rupG1AA8K3njeDNMKdov4o+dmnkAH7Jh8tjShMhNhoxHce3IzpczjhoE1EyYQcyPf1qdfhV35Xv096iWX5809pp1MZF2oE5eism8JaU9NpGClryVbKVKtup8ko9/tCqz01Czq5Vue40feMkGtdePulg59OhyyPLYldsObw8QlZydkrmgVZe6b+GyybeiHraTfDq4pvTgUrC4Cmm5J3IB5Ig1THEiYKHfRJ5hSSMDDODeBXc8Xh6mFssEVshNx/jbUQWuAVYQFw/GIquVHxr6btbevrWIoD+zmqcc0L98u9pYH8w7b+gMgVJNCC4QQz2NCGGWw9l9/TmLrKJgeXbG18n8D314le1zuna6/VfH9pXIlbNO4hgz5NLHJk="
matrix:
- PHP=5.2
- PHP=5.3
- PHP=5.4
- PHP=5.5
- PHP=5.6
- PHP=7.0
- PHP=7.1
- PHP=7.2
- PHP=7.3
- PHP=7.4
- PHP=8.0
###
### Install requirements
###
install:
# Get newer docker version
- max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get update; then break; else i=$((i+1)); fi done
- max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce; then break; else i=$((i+1)); fi done
- docker version
# Disable services enabled by default
# http://docs.travis-ci.com/user/database-setup/#MySQL
- sudo /etc/init.d/httpd stop || true
- sudo /etc/init.d/memcached stop || true
- sudo /etc/init.d/mongodb stop || true
- sudo /etc/init.d/mysql stop || true
- sudo /etc/init.d/nginx stop || true
- sudo /etc/init.d/postgresql stop || true
- sudo /etc/init.d/redis stop || true
- sudo service httpd stop || true
- sudo service memcached stop || true
- sudo service mongodb stop || true
- sudo service mysql stop || true
- sudo service nginx stop || true
- sudo service postgresql stop || true
- sudo service redis stop || true
- netstat -tulpn
###
### Check generation changes, build and test
###
before_script:
# Regenerate Dockerfiles and make sure nothing has changed (every stage)
- pip install ansible
- make generate
- git diff --quiet || { echo "Build Changes"; git diff; git status; false; }
# Build (multiple tries due to network outages)
- max=100; i=0; while [ $i -lt $max ]; do if make build-base-${PHP//.}; then break; else i=$((i+1)); fi; done; if [ $i -gt 98 ]; then false; fi
- make test-base-${PHP//.}
- max=100; i=0; while [ $i -lt $max ]; do if make build-mods-${PHP//.}; then break; else i=$((i+1)); fi; done; if [ $i -gt 98 ]; then false; fi
- make test-mods-${PHP//.}
- max=100; i=0; while [ $i -lt $max ]; do if make build-prod-${PHP//.}; then break; else i=$((i+1)); fi; done; if [ $i -gt 98 ]; then false; fi
- make test-prod-${PHP//.}
- max=100; i=0; while [ $i -lt $max ]; do if make build-work-${PHP//.}; then break; else i=$((i+1)); fi; done; if [ $i -gt 98 ]; then false; fi
- make test-work-${PHP//.}
# Test if PHP modules have changed
- ./build/gen-readme.sh "${PHP}"
- git diff --quiet || { echo "Build Changes"; git diff; git status; false; }
###
### Push to Dockerhub
###
script:
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin &&
if [ "${TRAVIS_BRANCH}" == "master" ]; then
echo "Pushing latest";
until docker push "${IMAGE}:${PHP}-base"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-mods"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-prod"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-work"; do sleep 1; done;
elif [[ ${TRAVIS_BRANCH} =~ ^(release-[.0-9]+)$ ]]; then
echo "Pushing branch ${TRAVIS_BRANCH}";
docker tag "${IMAGE}:${PHP}-base" "${IMAGE}:${PHP}-base-${TRAVIS_BRANCH}" &&
docker tag "${IMAGE}:${PHP}-mods" "${IMAGE}:${PHP}-mods-${TRAVIS_BRANCH}" &&
docker tag "${IMAGE}:${PHP}-prod" "${IMAGE}:${PHP}-prod-${TRAVIS_BRANCH}" &&
docker tag "${IMAGE}:${PHP}-work" "${IMAGE}:${PHP}-work-${TRAVIS_BRANCH}" &&
until docker push "${IMAGE}:${PHP}-base-${TRAVIS_BRANCH}"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-mods-${TRAVIS_BRANCH}"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-prod-${TRAVIS_BRANCH}"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-work-${TRAVIS_BRANCH}"; do sleep 1; done;
elif [ -n "${TRAVIS_TAG}" ]; then
echo "Pushing tag ${TRAVIS_TAG}";
docker tag "${IMAGE}:${PHP}-base" "${IMAGE}:${PHP}-base-${TRAVIS_TAG}" &&
docker tag "${IMAGE}:${PHP}-mods" "${IMAGE}:${PHP}-mods-${TRAVIS_TAG}" &&
docker tag "${IMAGE}:${PHP}-prod" "${IMAGE}:${PHP}-prod-${TRAVIS_TAG}" &&
docker tag "${IMAGE}:${PHP}-work" "${IMAGE}:${PHP}-work-${TRAVIS_TAG}" &&
until docker push "${IMAGE}:${PHP}-base-${TRAVIS_TAG}"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-mods-${TRAVIS_TAG}"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-prod-${TRAVIS_TAG}"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-work-${TRAVIS_TAG}"; do sleep 1; done;
elif [ "${TRAVIS_EVENT_TYPE}" = "cron" ]; then
if MY_TAG="$( git describe --exact-match "$(git rev-parse HEAD)" 2>/dev/null )"; then
echo "Pushing cron tag ${MY_TAG}";
docker tag "${IMAGE}:${PHP}-base" "${IMAGE}:${PHP}-base-${MY_TAG}" &&
docker tag "${IMAGE}:${PHP}-mods" "${IMAGE}:${PHP}-mods-${MY_TAG}" &&
docker tag "${IMAGE}:${PHP}-prod" "${IMAGE}:${PHP}-prod-${MY_TAG}" &&
docker tag "${IMAGE}:${PHP}-work" "${IMAGE}:${PHP}-work-${MY_TAG}" &&
until docker push "${IMAGE}:${PHP}-base-${MY_TAG}"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-mods-${MY_TAG}"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-prod-${MY_TAG}"; do sleep 1; done;
until docker push "${IMAGE}:${PHP}-work-${MY_TAG}"; do sleep 1; done;
fi
else
echo "Skipping push to dockerhub on normal branches";
fi
else
echo "Skipping push to dockerhub on PR";
fi

14
.yamllint Normal file
View File

@@ -0,0 +1,14 @@
---
# Use 'default' rules
extends: default
# Overwrite above default rules
rules:
colons:
max-spaces-before: 0
max-spaces-after: 60
comments:
require-starting-space: false
min-spaces-from-content: 1
line-length: disable
truthy: disable

475
CHANGELOG.md Normal file
View File

@@ -0,0 +1,475 @@
# Changelog
## Unreleased
## Release 0.146
This release adds lots of documentation about recently added features.
### Added
- Documentation
## Release 0.145
This is a massive restructuring release, which adds another layer on top of Ansible to easily manage/edit/add PHP tools and to configure their respective order of building and installing.
Additionally it introduces a new flavour: `slim` which is an intermediated stage between `prod` and `work`. It allows for a slim image with only required cli tools to work with the Devilbox.
### Added
- New PHP Flavour: `slim`
- Added `mhsendmail` for `arm64` architecture
- Added `wkhtmltopdf` for `arm64 architecture [#252](https://github.com/devilbox/docker-php-fpm/issues/252)
- Added `taskfile` (https://taskfile.dev/)
- Added mechanism to easily build custom images with custom set of PHP tools
- Added automated PHP tools dependency resolver (order of built is always correct)
- Added tons of documentation
### Changed
- Split out PHP tools into separate directories
### Fixed
- Fixed `xdebug` build
## Release 0.144
This is a massive restructuring release, which adds another layer on top of Ansible to easily manage/edit/add PHP extensions and to configure their respective order of building and loading.
### Added
- Added PHP extension: `lz4`
- Added PHP extension: `lzf`
- Added PHP extension: `zstd`
- Added mechanism to easily build custom images with custom set of PHP extensions
- Added automated PHP extension dependency resolver (order of built is always correct)
- Added tons of documentation
- Added Credit to contributors
### Changed
- Added serializer for Redis extension: `lz4`, `lzf` and `zstd`
- Restructured Documentation
- Split out PHP extensions into separate directories
## Release 0.143
### Added
- Added `phalcon` 5.x to PHP 8.0 and PHP 8.1
## Release 0.142
### Fixed
- Fixed `phalcon` module
- Fixed `swoole` module
- Fixed installation of wkhtmltopdf [#245](https://github.com/devilbox/docker-php-fpm/pull/245)
- FIxed installation of drupalconsole [#246](https://github.com/devilbox/docker-php-fpm/pull/246)
- Fixed installation of symfoni cli [#247](https://github.com/devilbox/docker-php-fpm/pull/247)
- Fixed installation of NodeJS
- Fixed installation of PostgreSQL client for PHP 5.6
- Fixed installation of PostgreSQL client for PHP 7.0
- Disabled Phalcon Devtools for PHP 7.4 as it breaks
## Release 0.141
### Fixed
- Fixed correct permission for `/opt/nvm` during startup
## Release 0.140
### Changed
- Ensure apt Jessie repositories are trusted beyond EOL
## Release 0.139
#### Added
- (Re-)added mongodb command line client
- (Re-)added postgresql command line client
### Changed
- Speed up `xargs` commands by using multi-CPU
- Use buildkit for building
## Release 0.138
#### Added
- Added arm64 support
- Added `vips` module for PHP 8.0
- Added `vips` module for PHP 8.1
- Added `swoole` module for PHP 8.1
#### Changed
- Separated nightly jobs
## Release 0.137
#### Fixed
- Fixed imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
#### Changed
- Ensured CI tests are platform agnostic (amd64 vs arm64)
- Ensured CI pipeline will work for long-running jobs
#### Removed
- Removed homebrew due to arm64 issues
- Removed postgres cmd client and apt repositories due to arm64 issues
- Removed mongodb cmd client and apt repositories due to arm64 issues
- Removed Ansible due to arm64 issues
## Release 0.136
#### Fixed
- Fixed `mongodb-org-shell` and `mongodb-org-tools` install
#### Added
- Re-added `mongodb` for PHP 5.3
#### Changed
- Switch PHP 5.4 base image to [devilbox/php-fpm-5.4](https://github.com/devilbox/docker-php-fpm-5.4) for potential arm64 support
- Switch PHP 5.5 base image to [devilbox/php-fpm-5.5](https://github.com/devilbox/docker-php-fpm-5.5) for potential arm64 support
- Changed base image back to Debian Jessie for PHP 5.2 and PHP 5.3
## Release 0.135
#### Fixed
- Fixed cloning of gitflow
- Fixed pidof issue on QUEMU by replacing it with pgrep [#854](https://github.com/cytopia/devilbox/issues/854)
#### Changed
- Changed PHP 5.2 and PHP 5.3 base images to Debian stretch
- Removed photoncms binaries (their GitHub organization went private)
- Removed `mongodb` extension from PHP 5.3 due to build errors
- Removed `ioncube` extension for PHP 5.2, PHP 5.3 and PHP 5.4 (arm64 only supported from PHP 5.5 onwards)
- Removed `codeception` from PHP 5.3
## Release 0.134
#### Changed
- Added extension `xdebug` to PHP 8.2
## Release 0.133
#### Added
- Added PHP 8.2: https://github.com/devilbox/docker-php-fpm-8.2
## Release 0.132
#### Fixed
- Fixed `nvm` PATH priority [#846](https://github.com/cytopia/devilbox/issues/846)
#### Added
- added extension `sqlsrv` to php 8.1
- added extension `pdo_sqlsrv` to php 8.1
#### Changed
- Changed postfix hostname to `localhost` instead of GitHub runners long name
## Release 0.131
#### Added
- Added binary `sqlite3` to all PHP images [#856](https://github.com/cytopia/devilbox/issues/856)
- Added binary `laravel` to PHP 8.0 and PHP 8.1 [#823](https://github.com/cytopia/devilbox/issues/823)
- Added AVIF support in GD for PHP 8.1 [#834](https://github.com/cytopia/devilbox/issues/834)
- Added extension `amqp` to PHP 8.0 and PHP 8.1 [#826](https://github.com/cytopia/devilbox/issues/826)
- Added extension `uploadprogress` to PHP 8.0 and PHP 8.1 [#158](https://github.com/devilbox/docker-php-fpm/pull/158)
- Added extension `imagick` to PHP 8.0 and PHP 8.1
- Added extension `rdkafka` to PHP 8.0 and PHP 8.1
- Added extension `xlswriter` to PHP 8.1
- Added extension `pdo_dblib` to PHP 8.1
- Added extension `uuid` to all PHP versions (except 5.2)
#### Changed
- Updated `php-cs-fixer` to latest version [#219](https://github.com/devilbox/docker-php-fpm/pull/219)
## Release 0.130
#### Fixed
- Fixed correct keys for `apt`
#### Added
- Added integration checks for `apt update`
## Release 0.129
#### Fixed
- Pinned module: `uploadprogress`
- Pinned module: `mongodb`
- Pinned lib: `libenchant`
- Pinned lib: `libicu`
- Pinned lib: `libvpx`
- Pinned PHP 8.0: https://github.com/devilbox/docker-php-fpm-8.0/pull/16
- Pinned PHP 8.1: https://github.com/devilbox/docker-php-fpm-8.1/pull/9
- Fixed `pgsql` apt key
- Fixed `deployer` download on cert issues
- Fixed `phpmd` download on cert issues
- Fixed `phpunit` download on cert issues
- Fixed `php-cs-fixer` download on cert issues
- Fixed building `sockets` on PHP 8.0 and PHP 8.1
- Fixed building `ffi` on PHP 7.4
#### Changed
- Removed `mcrypt` from PHP 8.1 as it is not yet supported
- Removed `enchant` from PHP 7.3 and PHP 7.4 as libenchant1 is not available via apt
- Updated PHP 8.0 base image to BullsEye: https://github.com/devilbox/docker-php-fpm-8.0/pull/17
- Updated PHP 8.1 base image to BullsEye: https://github.com/devilbox/docker-php-fpm-8.1/pull/10
- Updated PostgreSQL repos to Bullseye for PHP >= 7.3
- Updated `pip` to use Python3 for PHP >= 7.3
## Release 0.128
#### Added
- Adding `pdo_sqlsrv` to more PHP versions
## Release 0.127
#### Changed
- Adding `swoole` to more PHP 8.0
## Release 0.126
#### Changed
- Added Homebrew for all versions
## Release 0.125
#### Changed
- Re-added `opcache` for PHP 8.1
- Pin `ansible` version for all work images
- Pin `wp-cli` version for PHP 5.4 and 5.5
## Release 0.124
#### Fixed
- Fixed `pdo_sqlsrv` version for PHP 7.2
- Fixed `sqlsrv` version for PHP 7.2
- Fixed `swoole` version for PHP 7.1
- Fixed pip installation
#### Changed
- Removed `opcache` for PHP 8.1
- Removed `xlswriter` for PHP 8.1
- Removed `linuxbrew` for all versions
- [#201](https://github.com/devilbox/docker-php-fpm/issues/201) Deactivated `psr` and `phalcon` by default
- Removed `drush9` from PHP 7.0 and 7.1
- Removed `drupalconsole` from PHP 7.0 and 7.1
## Release 0.123
#### Fixed
- Fixex `redis` module compilation for PHP 8.1
- Fixed PHP Xdebug v3 defaults to:
```ini
xdebug.mode = Off
xdebug.start_with_request = default
xdebug.client_port = 9000
```
#### Changed
- Removed `pdo_dblib` from PHP 8.1 due to errors
## Release 0.122
#### Added
- Added `apcu`, `blackfire`, `igbinary`, `imap`, `mcrypt`, `memcache`, `msgpack`, `oauth`, `psr`, `solr`, `xlswriter`, `yaml` to PHP 8.0
- Added `apcu`, `igbinary`, `imap`, `mcrypt`, `memcache`, `msgpack`, `oauth`, `psr`, `solr`, `xlswriter`, `yaml` to PHP 8.1
#### Changed
- Migrate from Travis CI to GitHub Actions
## Release 0.121
#### Fixed
- Fixed `msgpack` install for PHP 7.0 - 7.4
#### Changed
- Compile `redis` extension with `msgpack` and `igbinary`
## Release 0.120
#### Fixed
- Fixed `zsh` install for PHP 5.6 and 7.0
## Release 0.119
#### Fixed
- Fixed `drupal` (drupal console launcher) for PHP 5.5, 5.6, 7.0 and 7.1
- Fixed `zsh` install for PHP 5.6 and 7.0
## Release 0.118
#### Fixed
- Fixed `mdl` rubygem
#### Added
- [#182](https://github.com/devilbox/docker-php-fpm/issues/182) Added `ioncube` to PHP 7.4
- Added `sqlsrv` to PHP 7.4
#### Changed
- Updated xdebug to latest possible version
## Release 0.117
#### Fixed
- [#755](https://github.com/cytopia/devilbox/issues/755) Add .composer/vendir/bin to $PATH variable
#### Added
- [#692](https://github.com/cytopia/devilbox/issues/692) Add custom supervisor config mountpoint
## Release 0.116
#### Fixed
- [#749](https://github.com/cytopia/devilbox/issues/749) Fix to disable PHP modules without trailing `*.so` extension
## Release 0.115
#### Fixed
- [#703](https://github.com/cytopia/devilbox/issues/703) Don't fail on uid/gid change
## Release 0.114
#### Fixed
- Use latest PHP 8.0 image
- Disabled gd-jis: https://bugs.php.net/bug.php?id=73582
#### Added
- Add PHP 8.1
- PHP module mongodb is added to PHP 8.0
#### Changed
- Composer is updated to v2 (/usr/local/bin/composer)
- Composer is available as v1 and v2 (/usr/local/bin/composer-[12])
## Release 0.113
#### Fixed
- Fixes nightly build pipeline
## Release 0.112
#### Fixed
- Fixes [166](https://github.com/devilbox/docker-php-fpm/issues/166) Missing `locale-gen` binary
#### Added
- Added vips extension
- Added xlswriter extension
## Release 0.111
#### Added
- Added xdebug for PHP 8.0
## Release 0.110
#### Fixed
- [169](https://github.com/devilbox/docker-php-fpm/issues/169) Fixes download for drupal console
- Fixes laravel installer for PHP 7.2
## Release 0.109
#### Fixed
- Fixed absolute paths in tests
## Release 0.108
#### Added
- Added ghostscript
- Added gsfonts
- Added imagick PDF support (via ghostscript)
- Added mupdf and mupdf-tools
#### Fixed
- Fixes Ansible installation
- Fixes MongoDB for PHP 5.6
- Fixes Redis for PHP 8.0
- Fixes policy.xml for Imagick
#### Changed
- Stricter version check for installed tools
## Release 0.107
#### Fixed
- Fixes login to Dockerhub for CI jobs
- Fixes imagick segfault by setting its threads to 1
#### Added
- Re-added imap for PHP 7.4
- Adding `certbot` binary
## Release 0.106
#### Fixed
- [#153](https://github.com/devilbox/docker-php-fpm/pull/153) Use numeric order for startup files
- Fix build of PHP-FPM 7.4 snmp module
- Disable PHP-FPM 8.0 uploadprogress module due to startup warnings
## Release 0.105
#### Fixed
- Fix pdo_sqlsrv install for PHP 7.1
- Fix sqlsrv install for PHP 7.1
- Fix composer memory issues during install
#### Added
- `phalcon` binary for PHP 7.3 and 7.4
## Release 0.104
#### Fixed
- Fix xdebug install for PHP 7.0
## Release 0.103
#### Added
- Add PHP [yaml](https://pecl.php.net/package/yaml) module
## Release 0.102
#### Added
- [#144](https://github.com/devilbox/docker-php-fpm/issues/144) Added CHANGELOG
#### Changed
- [#123](https://github.com/devilbox/docker-php-fpm/issues/123) Added Dart Sass and removed Ruby Sass
- Replace [scss-lint](https://github.com/sds/scss-lint) with [stylelint](https://github.com/stylelint/stylelint)

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM devilbox/php-fpm-5.2 FROM devilbox/php-fpm-5.2
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,12 +7,20 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 5.2 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="5.2-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.2-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.2-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.2-base"
### ###
@@ -27,7 +36,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -35,16 +44,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -66,7 +77,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.2' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.2' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -92,4 +103,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM devilbox/php-fpm-5.3 FROM devilbox/php-fpm-5.3
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,12 +7,20 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 5.3 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="5.3-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.3-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.3-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.3-base"
### ###
@@ -27,7 +36,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -35,16 +44,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -66,7 +77,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.3' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.3' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -92,4 +103,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,17 +1,26 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
FROM php:5.4-fpm # Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM devilbox/php-fpm-5.4
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 5.4 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="5.4-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.4-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.4-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.4-base"
### ###
@@ -27,7 +36,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -35,16 +44,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -66,7 +77,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.4' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.4' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -92,4 +103,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,17 +1,26 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
FROM php:5.5-fpm # Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM devilbox/php-fpm-5.5
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 5.5 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="5.5-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.5-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.5-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.5-base"
### ###
@@ -27,7 +36,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -35,16 +44,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -66,7 +77,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.5' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.5' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -92,4 +103,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM php:5.6-fpm FROM php:5.6-fpm
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,12 +7,20 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 5.6 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="5.6-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.6-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.6-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.6-base"
### ###
@@ -27,7 +36,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -35,16 +44,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -66,7 +77,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.6' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.6' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -92,4 +103,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM php:7.0-fpm FROM php:7.0-fpm
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,12 +7,20 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 7.0 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="7.0-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.0-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.0-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.0-base"
### ###
@@ -27,7 +36,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -35,16 +44,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -66,7 +77,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.0' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.0' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -92,4 +103,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM php:7.1-fpm FROM php:7.1-fpm
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,12 +7,20 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 7.1 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="7.1-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.1-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.1-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.1-base"
### ###
@@ -27,7 +36,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -35,16 +44,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -66,7 +77,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.1' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.1' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -92,4 +103,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM php:7.2-fpm FROM php:7.2-fpm
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,12 +7,20 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 7.2 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="7.2-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.2-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.2-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.2-base"
### ###
@@ -27,7 +36,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -35,16 +44,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -66,7 +77,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.2' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.2' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -92,4 +103,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM php:7.3-fpm FROM php:7.3-fpm
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,12 +7,20 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 7.3 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="7.3-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.3-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.3-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.3-base"
### ###
@@ -27,7 +36,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -35,16 +44,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -66,7 +77,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.3' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.3' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -92,4 +103,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,17 +1,26 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
FROM devilbox/php-fpm-7.4 # Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM php:7.4-fpm
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 7.4 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="7.4-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.4-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.4-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.4-base"
### ###
@@ -27,7 +36,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -35,16 +44,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -66,7 +77,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.4' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.4' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -92,4 +103,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM devilbox/php-fpm-8.0 FROM devilbox/php-fpm-8.0
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,12 +7,20 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 8.0 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="8.0-base" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="8.0-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 8.0-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 8.0-base"
### ###
@@ -27,7 +36,7 @@ ENV MY_USER="devilbox" \
### ###
### User/Group ### User/Group
### ###
RUN set -x \ RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \ && groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
@@ -35,16 +44,18 @@ RUN set -x \
### ###
### Upgrade (install ps) ### Upgrade (install ps)
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
### ###
### Configure ### Configure
### ###
RUN set -x \ RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \ && rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \ && mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \ && mkdir -p /var/lib/php/session \
@@ -66,7 +77,7 @@ COPY ./data/docker-entrypoint.d /docker-entrypoint.d
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.0' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.0' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -92,4 +103,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,107 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM devilbox/php-fpm-8.1
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="8.1-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 8.1-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 8.1-base"
###
### Envs
###
ENV MY_USER="devilbox" \
MY_GROUP="devilbox" \
MY_UID="1000" \
MY_GID="1000" \
PHP_VERSION="8.1"
###
### User/Group
###
RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
###
### Upgrade (install ps)
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/*
###
### Configure
###
RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \
&& mkdir -p /var/lib/php/wsdlcache \
&& chown -R devilbox:devilbox /var/lib/php/session \
&& chown -R devilbox:devilbox /var/lib/php/wsdlcache
###
### Copy files
###
COPY ./data/php-ini.d/php-8.1.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-8.1.conf /usr/local/etc/php-fpm.conf
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d /docker-entrypoint.d
###
### Verify
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.1' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
###
### Ports
###
EXPOSE 9000
###
### Entrypoint
###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,107 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-base.j2 instead.
FROM devilbox/php-fpm-8.2
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="8.2-base"
LABEL "org.opencontainers.image.title"="PHP-FPM 8.2-base"
LABEL "org.opencontainers.image.description"="PHP-FPM 8.2-base"
###
### Envs
###
ENV MY_USER="devilbox" \
MY_GROUP="devilbox" \
MY_UID="1000" \
MY_GID="1000" \
PHP_VERSION="8.2"
###
### User/Group
###
RUN set -eux \
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
###
### Upgrade (install ps)
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/*
###
### Configure
###
RUN set -eux \
&& rm -rf /usr/local/etc/php-fpm.d \
&& mkdir -p /usr/local/etc/php-fpm.d \
&& mkdir -p /var/lib/php/session \
&& mkdir -p /var/lib/php/wsdlcache \
&& chown -R devilbox:devilbox /var/lib/php/session \
&& chown -R devilbox:devilbox /var/lib/php/wsdlcache
###
### Copy files
###
COPY ./data/php-ini.d/php-8.2.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-8.2.conf /usr/local/etc/php-fpm.conf
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d /docker-entrypoint.d
###
### Verify
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.2' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
###
### Ports
###
EXPOSE 9000
###
### Entrypoint
###
CMD ["/usr/local/sbin/php-fpm"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -60,10 +60,18 @@ set_uid() {
fi fi
# Change uid and fix homedir permissions # Change uid and fix homedir permissions
log "info" "Changing user '${username}' uid to: ${uid}" "${debug}" log "info" "Changing user '${username}' uid to: ${uid}" "${debug}"
if ! run "usermod -u ${uid} ${username} 2>/dev/null" "${debug}"; then
run "usermod -u ${uid} ${username}" "${debug}" run "usermod -u ${uid} ${username}" "${debug}"
run "chown -R ${username} ${homedir}" "${debug}" fi
run "chown -R ${username} ${homedir} 2>/dev/null || true" "${debug}"
run "chown -R ${username} /var/lib/php/session" "${debug}" run "chown -R ${username} /var/lib/php/session" "${debug}"
run "chown -R ${username} /var/lib/php/wsdlcache" "${debug}" run "chown -R ${username} /var/lib/php/wsdlcache" "${debug}"
if [ -f "/var/spool/mail/devilbox" ]; then
run "chown -R ${username} /var/spool/mail/devilbox" "${debug}"
fi
if [ -d "/etc/supervisor/custom.d" ]; then
run "chown -R ${username} /etc/supervisor/custom.d" "${debug}"
fi
fi fi
fi fi
} }
@@ -100,12 +108,20 @@ set_gid() {
run "groupmod -g ${spare_gid} ${target_groupname}" "${debug}" run "groupmod -g ${spare_gid} ${target_groupname}" "${debug}"
fi fi
fi fi
# Change ugd and fix homedir permissions # Change gid and fix homedir permissions
log "info" "Changing group '${groupname}' gid to: ${gid}" "${debug}" log "info" "Changing group '${groupname}' gid to: ${gid}" "${debug}"
if ! run "groupmod -g ${gid} ${groupname} 2>/dev/null" "${debug}"; then
run "groupmod -g ${gid} ${groupname}" "${debug}" run "groupmod -g ${gid} ${groupname}" "${debug}"
run "chown -R :${groupname} ${homedir}" "${debug}" fi
run "chown -R :${groupname} ${homedir} 2>/dev/null || true" "${debug}"
run "chown -R :${groupname} /var/lib/php/session" "${debug}" run "chown -R :${groupname} /var/lib/php/session" "${debug}"
run "chown -R :${groupname} /var/lib/php/wsdlcache" "${debug}" run "chown -R :${groupname} /var/lib/php/wsdlcache" "${debug}"
if [ -f "/var/spool/mail/devilbox" ]; then
run "chown -R :${groupname} /var/spool/mail/devilbox" "${debug}"
fi
if [ -d "/etc/supervisor/custom.d" ]; then
run "chown -R :${groupname} /etc/supervisor/custom.d" "${debug}"
fi
fi fi
fi fi
} }

View File

@@ -2,7 +2,7 @@
set -e set -e
set -u set -u
set -p pipefail set -o pipefail
### ###
@@ -52,4 +52,4 @@ set_gid "NEW_GID" "${MY_GROUP}" "/home/${MY_USER}" "${DEBUG_LEVEL}"
### Startup ### Startup
### ###
log "info" "Starting $( php-fpm -v 2>&1 | head -1 )" "${DEBUG_LEVEL}" log "info" "Starting $( php-fpm -v 2>&1 | head -1 )" "${DEBUG_LEVEL}"
exec /usr/local/sbin/php-fpm exec "${@}"

View File

@@ -43,7 +43,6 @@ html_errors = Off
; Xdebug settings ; Xdebug settings
xdebug.default_enable = Off xdebug.mode = Off
xdebug.profiler_enable = Off xdebug.start_with_request = default
xdebug.remote_enable = Off xdebug.client_port = 9000
xdebug.remote_autostart = Off

View File

@@ -43,7 +43,6 @@ html_errors = Off
; Xdebug settings ; Xdebug settings
xdebug.default_enable = Off xdebug.mode = Off
xdebug.profiler_enable = Off xdebug.start_with_request = default
xdebug.remote_enable = Off xdebug.client_port = 9000
xdebug.remote_autostart = Off

View File

@@ -43,7 +43,6 @@ html_errors = Off
; Xdebug settings ; Xdebug settings
xdebug.default_enable = Off xdebug.mode = Off
xdebug.profiler_enable = Off xdebug.start_with_request = default
xdebug.remote_enable = Off xdebug.client_port = 9000
xdebug.remote_autostart = Off

View File

@@ -43,7 +43,6 @@ html_errors = Off
; Xdebug settings ; Xdebug settings
xdebug.default_enable = Off xdebug.mode = Off
xdebug.profiler_enable = Off xdebug.start_with_request = default
xdebug.remote_enable = Off xdebug.client_port = 9000
xdebug.remote_autostart = Off

View File

@@ -0,0 +1,48 @@
; ############################################################
; # Devilbox PHP defaults for 8.1-base
; ############################################################
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
; If none is present, the one from the previous flavour is inherited.
[PHP]
; Memory
; Note: "memory_limit" should be larger than "post_max_size"
memory_limit = 512M
; Timeouts
max_execution_time = 120
max_input_time = 120
; Uploads
; Note: "post_max_size" should be greater than "upload_max_filesize"
post_max_size = 72M
upload_max_filesize = 64M
max_file_uploads = 20
; Vars
variables_order = EGPCS
max_input_vars = 8000
max_input_nesting_level = 64
; Error reporting
; Note: error_log is dynamic and handled during start to set appropriate setting
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
xmlrpc_errors = Off
report_memleaks = On
display_errors = Off
display_startup_errors = Off
log_errors = On
html_errors = Off
; Xdebug settings
xdebug.mode = Off
xdebug.start_with_request = default
xdebug.client_port = 9000

View File

@@ -0,0 +1,48 @@
; ############################################################
; # Devilbox PHP defaults for 8.2-base
; ############################################################
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
; If none is present, the one from the previous flavour is inherited.
[PHP]
; Memory
; Note: "memory_limit" should be larger than "post_max_size"
memory_limit = 512M
; Timeouts
max_execution_time = 120
max_input_time = 120
; Uploads
; Note: "post_max_size" should be greater than "upload_max_filesize"
post_max_size = 72M
upload_max_filesize = 64M
max_file_uploads = 20
; Vars
variables_order = EGPCS
max_input_vars = 8000
max_input_nesting_level = 64
; Error reporting
; Note: error_log is dynamic and handled during start to set appropriate setting
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
xmlrpc_errors = Off
report_memleaks = On
display_errors = Off
display_startup_errors = Off
log_errors = On
html_errors = Off
; Xdebug settings
xdebug.mode = Off
xdebug.start_with_request = default
xdebug.client_port = 9000

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:5.2-mods FROM devilbox/php-fpm:5.2-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,21 +7,28 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 5.2 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="5.2-prod" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.2-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.2-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.2-prod"
### ###
### Install ### Install
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
locales-all \ locales-all \
postfix \ postfix \
postfix-pcre \ postfix-pcre \
@@ -28,23 +36,27 @@ RUN set -x \
rsyslog \ rsyslog \
socat \ socat \
supervisor \ supervisor \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
\ \
&& rm -rf /etc/supervisor* \ # Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& mkdir -p /etc/supervisor/conf.d \ && sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
&& mkdir -p /var/log/supervisor \
\ \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ # Setup Supervisor
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ && rm -rf /etc/supervisor* \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) && mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.2' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.2' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -77,7 +89,6 @@ VOLUME /var/log/php
VOLUME /var/mail VOLUME /var/mail
### ###
### Ports ### Ports
### ###
@@ -87,4 +98,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:5.3-mods FROM devilbox/php-fpm:5.3-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,21 +7,28 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 5.3 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="5.3-prod" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.3-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.3-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.3-prod"
### ###
### Install ### Install
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
locales-all \ locales-all \
postfix \ postfix \
postfix-pcre \ postfix-pcre \
@@ -28,23 +36,27 @@ RUN set -x \
rsyslog \ rsyslog \
socat \ socat \
supervisor \ supervisor \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
\ \
&& rm -rf /etc/supervisor* \ # Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& mkdir -p /etc/supervisor/conf.d \ && sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
&& mkdir -p /var/log/supervisor \
\ \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ # Setup Supervisor
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ && rm -rf /etc/supervisor* \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) && mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.3' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.3' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -77,7 +89,6 @@ VOLUME /var/log/php
VOLUME /var/mail VOLUME /var/mail
### ###
### Ports ### Ports
### ###
@@ -87,4 +98,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:5.4-mods FROM devilbox/php-fpm:5.4-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,21 +7,28 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 5.4 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="5.4-prod" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.4-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.4-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.4-prod"
### ###
### Install ### Install
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
locales-all \ locales-all \
postfix \ postfix \
postfix-pcre \ postfix-pcre \
@@ -28,23 +36,27 @@ RUN set -x \
rsyslog \ rsyslog \
socat \ socat \
supervisor \ supervisor \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
\ \
&& rm -rf /etc/supervisor* \ # Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& mkdir -p /etc/supervisor/conf.d \ && sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
&& mkdir -p /var/log/supervisor \
\ \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ # Setup Supervisor
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ && rm -rf /etc/supervisor* \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) && mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.4' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.4' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -77,7 +89,6 @@ VOLUME /var/log/php
VOLUME /var/mail VOLUME /var/mail
### ###
### Ports ### Ports
### ###
@@ -87,4 +98,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:5.5-mods FROM devilbox/php-fpm:5.5-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,21 +7,28 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 5.5 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="5.5-prod" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.5-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.5-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.5-prod"
### ###
### Install ### Install
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
locales-all \ locales-all \
postfix \ postfix \
postfix-pcre \ postfix-pcre \
@@ -28,23 +36,27 @@ RUN set -x \
rsyslog \ rsyslog \
socat \ socat \
supervisor \ supervisor \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
\ \
&& rm -rf /etc/supervisor* \ # Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& mkdir -p /etc/supervisor/conf.d \ && sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
&& mkdir -p /var/log/supervisor \
\ \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ # Setup Supervisor
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ && rm -rf /etc/supervisor* \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) && mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.5' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.5' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -77,7 +89,6 @@ VOLUME /var/log/php
VOLUME /var/mail VOLUME /var/mail
### ###
### Ports ### Ports
### ###
@@ -87,4 +98,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:5.6-mods FROM devilbox/php-fpm:5.6-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,21 +7,28 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 5.6 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="5.6-prod" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.6-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.6-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.6-prod"
### ###
### Install ### Install
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
locales-all \ locales-all \
postfix \ postfix \
postfix-pcre \ postfix-pcre \
@@ -28,23 +36,27 @@ RUN set -x \
rsyslog \ rsyslog \
socat \ socat \
supervisor \ supervisor \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
\ \
&& rm -rf /etc/supervisor* \ # Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& mkdir -p /etc/supervisor/conf.d \ && sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
&& mkdir -p /var/log/supervisor \
\ \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ # Setup Supervisor
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ && rm -rf /etc/supervisor* \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) && mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.6' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.6' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -77,7 +89,6 @@ VOLUME /var/log/php
VOLUME /var/mail VOLUME /var/mail
### ###
### Ports ### Ports
### ###
@@ -87,4 +98,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:7.0-mods FROM devilbox/php-fpm:7.0-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,21 +7,28 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 7.0 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="7.0-prod" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.0-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.0-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.0-prod"
### ###
### Install ### Install
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
locales-all \ locales-all \
postfix \ postfix \
postfix-pcre \ postfix-pcre \
@@ -28,23 +36,27 @@ RUN set -x \
rsyslog \ rsyslog \
socat \ socat \
supervisor \ supervisor \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
\ \
&& rm -rf /etc/supervisor* \ # Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& mkdir -p /etc/supervisor/conf.d \ && sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
&& mkdir -p /var/log/supervisor \
\ \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ # Setup Supervisor
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ && rm -rf /etc/supervisor* \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) && mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.0' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.0' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -77,7 +89,6 @@ VOLUME /var/log/php
VOLUME /var/mail VOLUME /var/mail
### ###
### Ports ### Ports
### ###
@@ -87,4 +98,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:7.1-mods FROM devilbox/php-fpm:7.1-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,21 +7,28 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 7.1 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="7.1-prod" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.1-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.1-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.1-prod"
### ###
### Install ### Install
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
locales-all \ locales-all \
postfix \ postfix \
postfix-pcre \ postfix-pcre \
@@ -28,23 +36,27 @@ RUN set -x \
rsyslog \ rsyslog \
socat \ socat \
supervisor \ supervisor \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
\ \
&& rm -rf /etc/supervisor* \ # Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& mkdir -p /etc/supervisor/conf.d \ && sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
&& mkdir -p /var/log/supervisor \
\ \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ # Setup Supervisor
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ && rm -rf /etc/supervisor* \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) && mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.1' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.1' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -77,7 +89,6 @@ VOLUME /var/log/php
VOLUME /var/mail VOLUME /var/mail
### ###
### Ports ### Ports
### ###
@@ -87,4 +98,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:7.2-mods FROM devilbox/php-fpm:7.2-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,21 +7,28 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 7.2 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="7.2-prod" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.2-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.2-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.2-prod"
### ###
### Install ### Install
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
locales-all \ locales-all \
postfix \ postfix \
postfix-pcre \ postfix-pcre \
@@ -28,23 +36,27 @@ RUN set -x \
rsyslog \ rsyslog \
socat \ socat \
supervisor \ supervisor \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
\ \
&& rm -rf /etc/supervisor* \ # Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& mkdir -p /etc/supervisor/conf.d \ && sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
&& mkdir -p /var/log/supervisor \
\ \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ # Setup Supervisor
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ && rm -rf /etc/supervisor* \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) && mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.2' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.2' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -77,7 +89,6 @@ VOLUME /var/log/php
VOLUME /var/mail VOLUME /var/mail
### ###
### Ports ### Ports
### ###
@@ -87,4 +98,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:7.3-mods FROM devilbox/php-fpm:7.3-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,21 +7,28 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 7.3 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="7.3-prod" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.3-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.3-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.3-prod"
### ###
### Install ### Install
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
locales-all \ locales-all \
postfix \ postfix \
postfix-pcre \ postfix-pcre \
@@ -28,23 +36,27 @@ RUN set -x \
rsyslog \ rsyslog \
socat \ socat \
supervisor \ supervisor \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
\ \
&& rm -rf /etc/supervisor* \ # Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& mkdir -p /etc/supervisor/conf.d \ && sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
&& mkdir -p /var/log/supervisor \
\ \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ # Setup Supervisor
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ && rm -rf /etc/supervisor* \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) && mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.3' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.3' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -77,7 +89,6 @@ VOLUME /var/log/php
VOLUME /var/mail VOLUME /var/mail
### ###
### Ports ### Ports
### ###
@@ -87,4 +98,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:7.4-mods FROM devilbox/php-fpm:7.4-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,21 +7,28 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 7.4 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="7.4-prod" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.4-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.4-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.4-prod"
### ###
### Install ### Install
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
locales-all \ locales-all \
postfix \ postfix \
postfix-pcre \ postfix-pcre \
@@ -28,23 +36,27 @@ RUN set -x \
rsyslog \ rsyslog \
socat \ socat \
supervisor \ supervisor \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
\ \
&& rm -rf /etc/supervisor* \ # Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& mkdir -p /etc/supervisor/conf.d \ && sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
&& mkdir -p /var/log/supervisor \
\ \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ # Setup Supervisor
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ && rm -rf /etc/supervisor* \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) && mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.4' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.4' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -77,7 +89,6 @@ VOLUME /var/log/php
VOLUME /var/mail VOLUME /var/mail
### ###
### Ports ### Ports
### ###
@@ -87,4 +98,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -1,4 +1,5 @@
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. # vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:8.0-mods FROM devilbox/php-fpm:8.0-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org> MAINTAINER "cytopia" <cytopia@everythingcli.org>
@@ -6,21 +7,28 @@ MAINTAINER "cytopia" <cytopia@everythingcli.org>
### ###
### Labels ### Labels
### ###
LABEL \ # https://github.com/opencontainers/image-spec/blob/master/annotations.md
name="cytopia's PHP-FPM 8.0 Image" \ #LABEL "org.opencontainers.image.created"=""
image="devilbox/php-fpm" \ #LABEL "org.opencontainers.image.version"=""
tag="8.0-prod" \ #LABEL "org.opencontainers.image.revision"=""
vendor="devilbox" \ LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
license="MIT" LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="8.0-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 8.0-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 8.0-prod"
### ###
### Install ### Install
### ###
RUN set -x \ RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \ && DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests apt-utils \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \
locales-all \ locales-all \
postfix \ postfix \
postfix-pcre \ postfix-pcre \
@@ -28,23 +36,27 @@ RUN set -x \
rsyslog \ rsyslog \
socat \ socat \
supervisor \ supervisor \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false apt-utils \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
\ \
&& rm -rf /etc/supervisor* \ # Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& mkdir -p /etc/supervisor/conf.d \ && sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
&& mkdir -p /var/log/supervisor \
\ \
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ # Setup Supervisor
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) \ && rm -rf /etc/supervisor* \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 strip --strip-all -p 2>/dev/null || true) && mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
### ###
### Verify ### Verify
### ###
RUN set -x \ RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \ && echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.0' \ && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.0' \
&& /usr/local/sbin/php-fpm --test \ && /usr/local/sbin/php-fpm --test \
@@ -77,7 +89,6 @@ VOLUME /var/log/php
VOLUME /var/mail VOLUME /var/mail
### ###
### Ports ### Ports
### ###
@@ -87,4 +98,5 @@ EXPOSE 9000
### ###
### Entrypoint ### Entrypoint
### ###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,102 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:8.1-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="8.1-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 8.1-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 8.1-prod"
###
### Install
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
locales-all \
postfix \
postfix-pcre \
cron \
rsyslog \
socat \
supervisor \
&& rm -rf /var/lib/apt/lists/* \
\
# Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
\
# Setup Supervisor
&& rm -rf /etc/supervisor* \
&& mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
###
### Verify
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.1' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
###
### Copy files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/postfix.sh /usr/local/sbin/postfix.sh
COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf
###
### Volumes
###
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,102 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-prod.j2 instead.
FROM devilbox/php-fpm:8.2-mods
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="8.2-prod"
LABEL "org.opencontainers.image.title"="PHP-FPM 8.2-prod"
LABEL "org.opencontainers.image.description"="PHP-FPM 8.2-prod"
###
### Install
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
locales-all \
postfix \
postfix-pcre \
cron \
rsyslog \
socat \
supervisor \
&& rm -rf /var/lib/apt/lists/* \
\
# Fix: rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Operation not permitted.
&& sed -i'' 's/.*imklog.*//g' /etc/rsyslog.conf \
\
# Setup Supervisor
&& rm -rf /etc/supervisor* \
&& mkdir -p /var/log/supervisor \
&& mkdir -p /etc/supervisor/conf.d \
&& mkdir -p /etc/supervisor/custom.d \
&& chown devilbox:devilbox /etc/supervisor/custom.d \
\
&& (find /usr/local/bin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/lib -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true) \
&& (find /usr/local/sbin -type f -print0 | xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) strip --strip-all -p 2>/dev/null || true)
###
### Verify
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.2' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
###
### Copy files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/postfix.sh /usr/local/sbin/postfix.sh
COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf
###
### Volumes
###
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -22,21 +22,32 @@ set_postfix() {
local debug="${7}" local debug="${7}"
local php_ini_file="${php_ini_dir}/devilbox-runtime-sendmail.ini" local php_ini_file="${php_ini_dir}/devilbox-runtime-sendmail.ini"
local catch_all= local enable_mail=
# Verify env value
if ! env_set "${env_varname}"; then if ! env_set "${env_varname}"; then
log "info" "\$${env_varname} not set." "${debug}" log "info" "\$${env_varname} not set." "${debug}"
log "info" "Postfix will not be started." "${debug}" log "info" "Postfix will not be started." "${debug}"
echo "" > "${php_ini_file}" echo "" > "${php_ini_file}"
return
fi
# Retrieve env value
enable_mail="$( env_get "${env_varname}" )"
# Enable postfix
if [ "${enable_mail}" = "1" ] || [ "${enable_mail}" = "2" ]; then
if [ "${enable_mail}" = "1" ]; then
log "info" "\$${env_varname} set to 1. Enabling postfix" "${debug}"
else else
catch_all="$( env_get "${env_varname}" )" log "info" "\$${env_varname} set to 2. Enabling postfix catch-all" "${debug}"
if [ "${catch_all}" = "1" ]; then fi
log "info" "\$${env_varname} set to 1. Enabling postfix catch-all" "${debug}"
# Configure PHP # Configure PHP
{ {
echo "[mail function]"; echo "[mail function]";
echo "sendmail_path = $( which sendmail ) -t -i"; echo "sendmail_path = $( command -v sendmail ) -t -i";
echo ";mail.force_extra_parameters ="; echo ";mail.force_extra_parameters =";
echo "mail.add_x_header = On"; echo "mail.add_x_header = On";
echo "mail.log = ${php_mail_log}"; echo "mail.log = ${php_mail_log}";
@@ -74,19 +85,22 @@ set_postfix() {
# Postfix configuration # Postfix configuration
run "postconf -e 'inet_protocols=ipv4'" "${debug}" run "postconf -e 'inet_protocols=ipv4'" "${debug}"
# Postfix catch-all
if [ "${enable_mail}" = "2" ]; then
run "postconf -e 'myhostname=localhost'" "${debug}"
run "postconf -e 'virtual_alias_maps=pcre:/etc/postfix/virtual'" "${debug}" run "postconf -e 'virtual_alias_maps=pcre:/etc/postfix/virtual'" "${debug}"
run "echo '/.*@.*/ ${username}' >> /etc/postfix/virtual" "${debug}" run "echo '/.*@.*/ ${username}' >> /etc/postfix/virtual" "${debug}"
run "newaliases" "${debug}" run "newaliases" "${debug}"
fi
elif [ "${catch_all}" = "0" ]; then elif [ "${enable_mail}" = "0" ]; then
log "info" "\$${env_varname} set to 0. Disabling postfix catch-all" "${debug}" log "info" "\$${env_varname} set to 0. Disabling postfix" "${debug}"
else else
log "err" "Invalid value for \$${env_varname}. Can only be 0 or 1. Prodived: ${catch_all}" "${debug}" log "err" "Invalid value for \$${env_varname}. Can only be 0, 1 or 2. Prodived: ${enable_mail}" "${debug}"
exit 1 exit 1
fi fi
fi
} }

View File

@@ -33,7 +33,7 @@ disable_modules() {
mod="$( echo "${mod}" | xargs )" # trim mod="$( echo "${mod}" | xargs )" # trim
# Find all config files that enable that module # Find all config files that enable that module
files="$( grep -Er "^(zend_)?extension.*(=|/)${mod}\.so" "${cfg_path}" || true )" files="$( grep -Er "^(zend_)?extension.*(=|/)${mod}(\\.so)?\$" "${cfg_path}" || true )"
if [ -n "${files}" ]; then if [ -n "${files}" ]; then
while read -r f; do while read -r f; do

View File

@@ -19,7 +19,7 @@ execute_custom_scripts() {
if [ ! -d "${script_dir}" ]; then if [ ! -d "${script_dir}" ]; then
run "mkdir -p ${script_dir}" "${debug}" run "mkdir -p ${script_dir}" "${debug}"
fi fi
script_files="$( find "${script_dir}" -type f -iname '*.sh' )" script_files="$( find -L "${script_dir}" -type f -iname '*.sh' | sort -n )"
# loop over them line by line # loop over them line by line
IFS=' IFS='

View File

@@ -2,7 +2,7 @@
set -e set -e
set -u set -u
set -p pipefail set -o pipefail
### ###
@@ -24,9 +24,6 @@ DVL_PHP_INI_DIR="/usr/local/etc/php/conf.d"
# php-fpm conf.d directory # php-fpm conf.d directory
DVL_PHP_FPM_DIR="/usr/local/etc/php-fpm.d" DVL_PHP_FPM_DIR="/usr/local/etc/php-fpm.d"
# This is the log file for any mail related functions
DVL_PHP_MAIL_LOG="/var/log/mail.log"
# This file holds error and access log definitions # This file holds error and access log definitions
DVL_PHP_FPM_CONF_LOGFILE="${DVL_PHP_FPM_DIR}/zzz-entrypoint-logfiles.conf" DVL_PHP_FPM_CONF_LOGFILE="${DVL_PHP_FPM_DIR}/zzz-entrypoint-logfiles.conf"
DVL_PHP_INI_CONF_LOGFILE="${DVL_PHP_INI_DIR}/zzz-entrypoint-logfiles.ini" DVL_PHP_INI_CONF_LOGFILE="${DVL_PHP_INI_DIR}/zzz-entrypoint-logfiles.ini"
@@ -34,6 +31,9 @@ DVL_PHP_INI_CONF_LOGFILE="${DVL_PHP_INI_DIR}/zzz-entrypoint-logfiles.ini"
# PHP-FPM log dir # PHP-FPM log dir
DVL_FPM_LOG_DIR="/var/log/php" DVL_FPM_LOG_DIR="/var/log/php"
# This is the log file for any mail related functions
DVL_PHP_MAIL_LOG="${DVL_FPM_LOG_DIR}/mail.log"
# Custom ini dir (to be copied to actual ini dir) # Custom ini dir (to be copied to actual ini dir)
DVL_PHP_CUST_INI_DIR="/etc/php-custom.d" DVL_PHP_CUST_INI_DIR="/etc/php-custom.d"
@@ -138,7 +138,7 @@ done
### ###
### Supervisor: rsyslogd & postfix ### Supervisor: rsyslogd & postfix
### ###
if [ "$( env_get "ENABLE_MAIL" )" = "1" ]; then if [ "$( env_get "ENABLE_MAIL" )" = "1" ] || [ "$( env_get "ENABLE_MAIL" )" = "2" ]; then
supervisor_add_service "rsyslogd" "/usr/sbin/rsyslogd -n" "${DVL_SUPERVISOR_CONFD}" "${DEBUG_LEVEL}" "1" supervisor_add_service "rsyslogd" "/usr/sbin/rsyslogd -n" "${DVL_SUPERVISOR_CONFD}" "${DEBUG_LEVEL}" "1"
supervisor_add_service "postfix" "/usr/local/sbin/postfix.sh" "${DVL_SUPERVISOR_CONFD}" "${DEBUG_LEVEL}" supervisor_add_service "postfix" "/usr/local/sbin/postfix.sh" "${DVL_SUPERVISOR_CONFD}" "${DEBUG_LEVEL}"
fi fi
@@ -190,4 +190,4 @@ execute_custom_scripts "/startup.2.d" "${DEBUG_LEVEL}"
### Startup ### Startup
### ###
log "info" "Starting supervisord" "${DEBUG_LEVEL}" log "info" "Starting supervisord" "${DEBUG_LEVEL}"
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf exec "${@}"

View File

@@ -22,29 +22,22 @@ set -o pipefail
### ###
### Variables ### Variables
### ###
if [ -f "/etc/alpine-release" ]; then MAILLOG="/var/log/mail.log"
MAILLOG="/var/log/maillog"
elif [ -f "/etc/debian_version" ]; then
MAILLOG="/var/log/mail.log"
else
MAILLOG="/var/log/maillog"
fi
MAILPID="/var/spool/postfix/pid/master.pid" MAILPID="/var/spool/postfix/pid/master.pid"
### ###
### Sanity checks ### Sanity checks
### ###
if ! command -v pidof >/dev/null 2>&1; then if ! command -v pgrep >/dev/null 2>&1; then
echo "pidof is required for cleaning up tail command." echo "pgrep is required for cleaning up tail command."
exit 1 exit 1
fi fi
# Give rsyslogd some time to start up # Give rsyslogd some time to start up
sleep 2 sleep 2
if ! pidof rsyslogd >/dev/null 2>&1; then if ! pgrep rsyslogd >/dev/null 2>&1; then
echo "rsyslogd is not running, but required for mail logging." echo "rsyslogd is not running, but required for mail logging."
exit 1 exit 1
fi fi

View File

@@ -6,4 +6,4 @@ pidfile = /var/run/supervisord.pid
childlogdir = /var/log/supervisor childlogdir = /var/log/supervisor
[include] [include]
files = /etc/supervisor/conf.d/*.conf files = /etc/supervisor/conf.d/*.conf /etc/supervisor/custom.d/*.conf

View File

@@ -0,0 +1,622 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:5.2-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until \
&& echo "deb [trusted=yes] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mysql-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& apt-get update \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '5.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '5.2' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
\
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '5.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:5.2-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-5.2.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-5.2.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '5.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '5.2' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '5.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.2' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.2-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.2-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.2-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,622 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:5.3-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until \
&& echo "deb [trusted=yes] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mysql-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& apt-get update \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '5.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '5.3' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
\
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '5.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:5.3-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-5.3.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-5.3.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '5.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '5.3' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '5.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.3' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.3-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.3-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.3-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,622 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:5.4-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until \
&& echo "deb [trusted=yes] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mysql-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& apt-get update \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '5.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '5.4' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
\
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '5.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:5.4-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-5.4.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-5.4.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '5.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '5.4' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '5.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.4' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.4-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.4-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.4-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,622 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:5.5-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until \
&& echo "deb [trusted=yes] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mysql-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& apt-get update \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '5.5' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '5.5' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
\
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '5.5' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:5.5-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-5.5.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-5.5.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '5.5' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '5.5' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '5.5' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.5' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.5-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.5-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.5-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,626 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:5.6-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
&& echo "deb http://ftp.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mysql-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& apt-get update \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients \
mongo-tools; \
else \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '5.6' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '5.6' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
\
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '5.6' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:5.6-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-5.6.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-5.6.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '5.6' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '5.6' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '5.6' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.6' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="5.6-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 5.6-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 5.6-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,626 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:7.0-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
&& echo "deb http://ftp.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mysql-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& apt-get update \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients \
mongo-tools; \
else \
apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-clients; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '7.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '7.0' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb https://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update; \
fi \
\
&& if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client; \
fi \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '7.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:7.0-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-7.0.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-7.0.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '7.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '7.0' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '7.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.0' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.0-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.0-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.0-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,620 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:7.1-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
&& echo "deb http://ftp.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mariadb-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
&& echo "deb http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-org-tools \
mongodb-org-shell \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '7.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '7.1' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '7.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:7.1-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-7.1.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-7.1.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '7.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '7.1' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '7.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.1' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.1-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.1-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.1-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,620 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:7.2-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
&& echo "deb http://ftp.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mariadb-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
&& echo "deb http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-org-tools \
mongodb-org-shell \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '7.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '7.2' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '7.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:7.2-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-7.2.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-7.2.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '7.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '7.2' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '7.2' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.2' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.2-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.2-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.2-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,620 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:7.3-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
&& echo "deb http://ftp.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mariadb-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-org-tools \
mongodb-org-shell \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '7.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '7.3' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '7.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:7.3-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-7.3.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-7.3.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '7.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '7.3' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '7.3' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.3' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.3-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.3-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.3-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,620 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:7.4-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
&& echo "deb http://ftp.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mariadb-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-org-tools \
mongodb-org-shell \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '7.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '7.4' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '7.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:7.4-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-7.4.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-7.4.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '7.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '7.4' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '7.4' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^7.4' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="7.4-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 7.4-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 7.4-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,620 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:8.0-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
&& echo "deb http://ftp.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mariadb-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-org-tools \
mongodb-org-shell \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '8.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '8.0' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '8.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:8.0-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-8.0.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-8.0.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '8.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '8.0' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '8.0' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.0' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="8.0-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 8.0-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 8.0-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@@ -0,0 +1,620 @@
# vi: ft=dockerfile
# Auto-generated via Ansible: edit ./ansible/DOCKERFILES/Dockerfile-slim.j2 instead.
########################################################################################################################
########################################################################################################################
###
### Stage 1/4: Devilbox slim image (BASE BUILDER)
###
########################################################################################################################
########################################################################################################################
###
### Installs all cli tools required to run Devilbox and its intranet
###
FROM devilbox/php-fpm:8.1-prod as devilbox-slim-base-builder
###
### Install apt Tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
apt-transport-https \
ca-certificates \
curl \
dirmngr \
gnupg
###
### Add apt repositories
###
RUN set -eux \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 \
&& echo "deb http://ftp.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list \
&& curl -sS -L --fail "https://packages.blackfire.io/gpg.key" | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://packages.blackfire.io/debian any main" > /etc/apt/sources.list.d/blackfire.list \
&& true
###
### Install build_dep
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
libsnappy-dev \
&& rm -rf /var/lib/apt/lists/*
###
### Add common tools
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
file \
git \
mariadb-client \
redis-tools \
sqlite3
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Devilbox required cli tools from group_vars (slim.yml)
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
blackfire-agent \
\
&& rm -rf /var/lib/apt/lists/* \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& DEB_HOST_ARCH="$( dpkg-architecture --query DEB_HOST_ARCH )" \
&& if [ "${DEB_HOST_ARCH}" = "amd64" ] || [ "${DEB_HOST_ARCH}" = "arm64" ]; then \
MHSENDMAIL_URL="https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_${DEB_HOST_ARCH}" \
&& curl -sS -L --fail "${MHSENDMAIL_URL}" > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
else \
printf '%s\n%s\n%s\n' '#!/bin/sh' 'echo "Not available for this platform."' 'exit 1' > /usr/local/bin/mhsendmail \
&& chmod +x /usr/local/bin/mhsendmail; \
fi \
\
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 20691EEC35216C63CAF66CE1656408E390CFB1F5 \
&& echo "deb http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" > /etc/apt/sources.list.d/mongo.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
mongodb-org-tools \
mongodb-org-shell \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '8.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '8.1' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \
&& cd /usr/local/src/mysqldump-secure \
&& git checkout $(git describe --abbrev=0 --tags) \
&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \
&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \
&& touch /var/log/mysqldump-secure.log \
&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \
&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \
&& chmod 0400 /etc/mysqldump-secure.conf \
&& chmod 0400 /etc/mysqldump-secure.cnf \
&& chmod 0644 /var/log/mysqldump-secure.log \
&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \
&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \
&& cd / \
&& rm -rf /usr/local/src/mysqldump-secure \
\
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& curl -sS -k -L --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgsql.list \
&& apt-get update \
\
&& apt-get install -y --no-install-recommends --no-install-suggests \
postgresql-client \
\
&& rm -rf /var/lib/apt/lists/* \
&& if echo '8.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Prepare required shared libraries for copying (keep symlinks)
###
RUN set -eux \
&& LIB_GNU_DIR="/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& USR_LIB_DIR="/usr/lib" \
&& USR_LIB_GNU_DIR="/usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
\
&& mkdir /tmp/lib-gnu \
&& mkdir /tmp/usr-lib \
&& mkdir /tmp/usr-lib-gnu \
\
&& LIB_GNU="libreadline" \
&& USR_LIB="libsnappy libtcmalloc libv8" \
&& USR_LIB_GNU="liblua libpq libpcrecpp libboost libjemalloc libunwind libhiredis libedit libyaml-cpp libstemmer libsnappy libpcap libbsd liblzf" \
\
&& for lib in ${LIB_GNU}; do \
if ls -1 "${LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${LIB_GNU_DIR}"; \
cp -r ${LIB_GNU_DIR}/${lib}* /tmp/lib-gnu/; \
fi \
done \
&& for lib in ${USR_LIB}; do \
if ls -1 "${USR_LIB_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_DIR}"; \
cp -r ${USR_LIB_DIR}/${lib}* /tmp/usr-lib/; \
fi \
done \
&& for lib in ${USR_LIB_GNU}; do \
if ls -1 "${USR_LIB_GNU_DIR}/" | grep "^${lib}" >/dev/null; then \
echo "Coping '${lib}' from: ${USR_LIB_GNU_DIR}"; \
cp -r ${USR_LIB_GNU_DIR}/${lib}* /tmp/usr-lib-gnu/; \
fi \
done
###
### Fix expected PostgreSQL directories
###
### This might not exist on arm64 as software was not available,
### but they are still needed to be present, so we can copy them.
###
RUN set -eux \
&& if [ ! -d "/usr/lib/postgresql" ]; then \
mkdir "/usr/lib/postgresql"; \
fi \
&& if [ ! -d "/usr/share/postgresql-common" ]; then \
mkdir "/usr/share/postgresql-common"; \
fi
###
### Prepare MongoDB binaries for copying.
###
### They might not be available on all architectures (e.g.: arm64).
###
RUN set -eux \
&& mkdir /tmp/mongo \
&& if ls -1 "/usr/bin/" | grep "^mongo" >/dev/null; then \
cp -r /usr/bin/mongo* /tmp/mongo/; \
fi
###
### Strip debugging information to smallen filesize
###
RUN set -eux \
&& STRIP_USR_BINS="blackfire mongo mysql redis sqlite" \
&& STRIP_DIRS="/usr/lib/postgresql/ /usr/share/postgresql-common/ /tmp" \
\
&& for bin in ${STRIP_USR_BINS}; do \
( \
find /usr/bin/ -name "${bin}"* -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& for dir in ${STRIP_DIRS}; do \
( \
find ${dir} -type f -print0 \
| xargs -n1 -0 -P$(getconf _NPROCESSORS_ONLN) sh -c \
'if [ -f "${1}" ]; then echo "Strip: ${1}"; strip --strip-all -p "${1}" 2>/dev/null || true; fi' -- \
) \
done \
\
&& strip --strip-all -p /usr/local/bin/mhsendmail 2>/dev/null || true \
&& strip --strip-all -p /usr/local/bin/mysqldump-secure 2>/dev/null || true
########################################################################################################################
########################################################################################################################
###
### Stage 2/4: Devilbox slim image (BASE)
###
########################################################################################################################
########################################################################################################################
###
### Copies all cli tools required to run Devilbox and its intranet into a clean image
###
FROM devilbox/php-fpm:8.1-prod as devilbox-slim-base
ARG ARCH
###
### Install tools type: apt
###
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
# ---------- type: apt ----------
dnsutils \
iputils-ping \
netcat-openbsd \
sudo \
&& rm -rf /var/lib/apt/lists/*
###
### Copy shared libraries (required by MongoDB, MySQL, PostgreSQL and Redis)
###
COPY --from=devilbox-slim-base-builder /tmp/lib-gnu/ /lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib-gnu/ /usr/lib/${ARCH}-linux-gnu/
COPY --from=devilbox-slim-base-builder /tmp/usr-lib/ /usr/lib/
###
### Copy system files
###
COPY --from=devilbox-slim-base-builder /etc/group /etc/group
COPY --from=devilbox-slim-base-builder /etc/passwd /etc/passwd
COPY --from=devilbox-slim-base-builder /etc/shadow /etc/shadow
###
### Copy Blackfire
###
COPY --from=devilbox-slim-base-builder /etc/blackfire /etc/blackfire
COPY --from=devilbox-slim-base-builder /etc/default/blackfire-agent /etc/default/blackfire-agent
COPY --from=devilbox-slim-base-builder /usr/bin/blackfire* /usr/bin/
COPY --from=devilbox-slim-base-builder /var/log/blackfire /var/log/blackfire
###
### Copy mhsendmail
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mhsendmail /usr/local/bin/
###
### Copy MongoDB client (if exists)
###
COPY --from=devilbox-slim-base-builder /tmp/mongo/ /usr/bin/
###
### Copy MysQL Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/mysql* /usr/bin/
###
### Copy mysqldump-secure
###
COPY --from=devilbox-slim-base-builder /usr/local/bin/mysqldump-secure /usr/local/bin/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.conf /etc/
COPY --from=devilbox-slim-base-builder /etc/mysqldump-secure.cnf /etc/
COPY --from=devilbox-slim-base-builder /var/log/mysqldump-secure.log /var/log/
###
### Copy PostgreSQL
###
COPY --from=devilbox-slim-base-builder /usr/lib/postgresql /usr/lib/postgresql
COPY --from=devilbox-slim-base-builder /usr/share/postgresql-common /usr/share/postgresql-common
COPY --from=devilbox-slim-base-builder /usr/share/perl5 /usr/share/perl5
###
### Create PostgreSQL symlinks
###
RUN set -eux \
&& if [ -f "/usr/share/postgresql-common/pg_wrapper" ]; then \
ln -s ../share/postgresql-common/pg_wrapper /usr/bin/clusterdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createlang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/createuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/droplang \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/dropuser \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_basebackup \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dump \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_dumpall \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_isready \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivewal \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_receivexlog \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_recvlogical \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pg_restore \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/pgbench \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/psql \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/reindexdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumdb \
&& ln -s ../share/postgresql-common/pg_wrapper /usr/bin/vacuumlo; \
fi
###
### Copy Redis Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/redis* /usr/bin/
###
### Copy SQLite Client
###
COPY --from=devilbox-slim-base-builder /usr/bin/sqlite* /usr/bin/
###
### ADD PHP configuration files
###
COPY ./data/php-ini.d/php-8.1.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
COPY ./data/php-fpm.conf/php-fpm-8.1.conf /usr/local/etc/php-fpm.conf
###
### ADD Devilbox configuration files
###
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox
COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox
###
### Configure Bash
###
RUN set -eux \
&& { \
echo; \
echo "# [Devilbox] Ensure /usr/local(s)?bin is in PATH"; \
echo 'PATH="${PATH}:/usr/local/bin:/usr/local/sbin"'; \
echo "export PATH"; \
echo; \
echo "# [Devilbox] Source Devilbox main bash config"; \
echo ". /etc/bash-devilbox"; \
echo; \
echo "# [Devilbox] Source Devilbox custom configs"; \
echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \
echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \
echo " if [ -r \"\${f}\" ]; then"; \
echo " . \"\${f}\""; \
echo " fi"; \
echo " done"; \
echo " unset f"; \
echo "fi"; \
} | tee -a /home/${MY_USER}/.bashrc /root/.bashrc \
&& chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/.bashrc
########################################################################################################################
########################################################################################################################
###
### Stage 3/4: Devilbox slim image (BASE TEST)
###
########################################################################################################################
########################################################################################################################
###
### Test all Devilbox cli utils if copying was successful
###
FROM devilbox-slim-base as devilbox-slim-base-test
RUN set -eux \
&& mysql --version \
&& redis-cli --version \
&& sqlite3 --version
###
### Check if available tools slim
###
# -------------------- dig --------------------
RUN set -eux \
&& dig -v 2>&1 | grep -E '[0-9]\.[0-9]' \
&& true
# -------------------- netcat --------------------
RUN set -eux \
&& nc -h 2>&1 | grep netcat \
&& true
# -------------------- ping --------------------
RUN set -eux \
&& ping -V | grep ^ping \
&& true
# -------------------- sudo --------------------
RUN set -eux \
&& sudo --version | grep -E 'version [0-9]+\.[0-9]+' \
&& true
# -------------------- blackfire --------------------
RUN set -eux \
&& blackfire version \
&& blackfire-agent -v \
\
&& true
# -------------------- mhsendmail --------------------
RUN set -eux \
&& mhsendmail -h 2>&1 | grep 'Usage' \
&& true
# -------------------- mongo_client --------------------
RUN set -eux \
&& if echo '8.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongofiles --version; \
fi \
else \
mongofiles --version; \
fi \
\
&& if echo '8.1' | grep -E '^(5.2|5.3|5.4|5.5)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
mongo --version; \
fi \
else \
mongo --version; \
fi \
\
&& true
# -------------------- mysqldumpsecure --------------------
RUN set -eux \
&& mysqldump-secure --version | grep -E 'Version:\s*[0-9][.0-9]+' \
&& true
# -------------------- pgsql_client --------------------
RUN set -eux \
&& if echo '8.1' | grep -E '^(5.2|5.3|5.4|5.5|5.6|7.0)$' >/dev/null; then \
if [ "$(dpkg-architecture --query DEB_BUILD_ARCH)" = "amd64" ]; then \
pg_isready --version; \
fi \
else \
pg_isready --version; \
fi \
\
&& true
###
### Re-activate modules which have been deactivated in mods (for testing).
###
RUN set -eux \
&& if find /usr/local/lib/php/extensions/ -name phalcon.so | grep phalcon; then \
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini; \
fi \
&& if find /usr/local/lib/php/extensions/ -name psr.so | grep psr; then \
echo "extension=psr.so" > /usr/local/etc/php/conf.d/docker-php-ext-psr.ini; \
fi
###
### Check if PHP still works
###
RUN set -eux \
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.1' \
&& /usr/local/sbin/php-fpm --test \
\
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
\
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
&& rm -f /usr/local/etc/php/php.ini
########################################################################################################################
########################################################################################################################
###
### Stage 4/4: Devilbox slim image (FINAL)
###
########################################################################################################################
########################################################################################################################
###
### Prepare final base image (STAGE: slim)
###
FROM devilbox-slim-base as slim
MAINTAINER "cytopia" <cytopia@everythingcli.org>
###
### Labels
###
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
#LABEL "org.opencontainers.image.created"=""
#LABEL "org.opencontainers.image.version"=""
#LABEL "org.opencontainers.image.revision"=""
LABEL "maintainer"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.authors"="cytopia <cytopia@everythingcli.org>"
LABEL "org.opencontainers.image.url"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.documentation"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.source"="https://github.com/devilbox/docker-php-fpm"
LABEL "org.opencontainers.image.vendor"="devilbox"
LABEL "org.opencontainers.image.licenses"="MIT"
LABEL "org.opencontainers.image.ref.name"="8.1-slim"
LABEL "org.opencontainers.image.title"="PHP-FPM 8.1-slim"
LABEL "org.opencontainers.image.description"="PHP-FPM 8.1-slim"
###
### Volumes
###
VOLUME /shared/backups
VOLUME /var/log/php
VOLUME /var/mail
###
### Ports
###
EXPOSE 9000
###
### Where to start inside the container
###
WORKDIR /shared/httpd
###
### Entrypoint
###
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
ENTRYPOINT ["/docker-entrypoint.sh"]

Some files were not shown because too many files have changed in this diff Show More