Compare commits

...
215 Commits
Author SHA1 Message Date
Isaac Bennetch 2b79d71002 Update to 5.1.3 release
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2022-02-11 08:58:24 -05:00
Isaac Bennetch 4dd05de348 Update to 5.1.2 release
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2022-01-21 22:08:10 -05:00
William Desportes 7c28533a32 Fix #325 - Upgrade to PHP 8 2021-08-23 17:39:00 +02:00
William Desportes 056d2b51fd Write CHANGELOG entries since 4.9.2 2021-08-23 17:26:34 +02:00
William Desportes 030928a01e Fix #345 - Add back composer.json and remove non needed source files 2021-08-23 16:46:30 +02:00
William Desportes a73a82a790 Change the tags list link to the official image 2021-08-13 02:59:02 +02:00
William Desportes 0f4250dc7f Move test section to the end
I bet most users to not care about it
2021-08-13 02:55:48 +02:00
William Desportes 17b7a91289 Add a warning and example on the README
Ref: #338
Ref: #342
2021-08-13 02:53:23 +02:00
William Desportes 886f7ae6e3 Fix yaml format fence on the README 2021-08-13 02:47:32 +02:00
William Desportes 1655371fb0 Remove microbadger, it has shutdown 2021-08-13 02:45:41 +02:00
William Desportes 60c187d10d Add some format details from the PHP FAQ
Closes: #328
2021-08-13 02:42:49 +02:00
William Desportes 3dafd123f8 Merge #341 - Fix GPG keyservers 2021-08-13 01:43:47 +02:00
Daniel Rudolf e8ade8e3b1 Follow-up: GPG: Fix GPG keyservers
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2021-08-11 20:25:33 +02:00
Daniel Rudolf 12e6fdf738 GPG: Fix GPG keyservers
sks-keyservers.net was shut down some time ago. keys.gnupg.net is just
an alias. Neither pgp.mit.edu, nor keyserver.pgp.com are available
right now, but there was no take-down notice, so we should assume they
are temporarily unavailable. Use keys.openpgp.org as main alternative.

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2021-08-11 18:49:58 +02:00
Isaac Bennetch 935605b8d0 Update to 5.1.1 release
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2021-06-04 00:45:29 -04:00
Isaac Bennetch 4482d47ca7 Improve documentation
Add some missing information, fix typos, restructure, and improve
readability

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2021-03-17 21:22:05 -04:00
Isaac Bennetch 3d8c2ba403 Update to 5.1.0 release
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2021-02-24 01:44:19 -05:00
William Desportes e09f731a32 Merge #324 - Add expose_php env back
It was broken in #320 implementation
2021-02-07 22:02:42 +01:00
J0WI d383a98040 Revert HIDE_PHP_VERSION removal 2021-02-07 21:25:36 +01:00
William Desportes bd7de17631 Add MEMORY_LIMIT to allowed ENV names
Added in #320
See: https://github.com/docker-library/official-images/pull/9426
2021-02-02 00:12:33 +01:00
William Desportes 49a7e0fba7 Make the new MEMORY_LIMIT ENV work for phpMyAdmin configs
Added in #320
See: https://github.com/docker-library/official-images/pull/9426
2021-02-02 00:08:42 +01:00
William Desportes b0beabb4ed Add back HIDE_PHP_VERSION to Docker hub readme
Removed in #320 by mistake
See: https://github.com/docker-library/official-images/pull/9426
2021-02-02 00:05:26 +01:00
William Desportes 1a7be47268 Fix PMA_QUERYHISTORYMAX ENV in config.inc.php
See: https://github.com/docker-library/official-images/pull/9426
2021-02-01 23:53:40 +01:00
William Desportes 8dc7e66dec Merge #320 - Generate phpmyadmin-misc.ini from ENVs 2021-01-30 00:22:21 +01:00
William Desportes d6ab5de683 Add a missed assertion on max_execution_time 2021-01-30 00:15:16 +01:00
J0WIandWilliam Desportes e1bfab5583 Generate phpmyadmin-misc.ini from ENVs 2021-01-30 00:02:30 +01:00
William Desportes 3ba3be3492 Merge #322 - Add PMA_CONTROLPASS 2021-01-29 23:59:11 +01:00
William Desportes 4537d1869c Merge #323 - Re work the test system 2021-01-29 23:58:01 +01:00
William Desportes d7b3994b3a Add a test for PMA_HOST 2021-01-29 23:52:24 +01:00
William Desportes d91c4ba999 Clean old CI files 2021-01-29 23:00:38 +01:00
William Desportes 56fbf97a95 Add more tests for UPLOAD_LIMIT 2021-01-29 21:52:36 +01:00
William Desportes 71627ad719 Re-work the testing scripts 2021-01-29 21:12:55 +01:00
William Desportes 568e5ed308 Use healthcheck strategy for running tests 2021-01-29 14:14:08 +01:00
William Desportes a4dd0817f0 Add a test for PMA_CONTROLPASS secret file 2021-01-28 22:50:06 +01:00
William Desportes 508c9b991c Add PMA_CONTROLPASS to the README file 2021-01-28 22:49:22 +01:00
William Desportes 5d45c24548 Update different versions to add PMA_CONTROLPASS 2021-01-28 22:49:08 +01:00
William Desportes 4e6ed4b275 Update actions/checkout to v2 2021-01-28 22:46:14 +01:00
nicolas.clementz d0f71fbf3b Add PMA_CONTROLPASS to variables thas can be read from a file using _FILE 2021-01-28 11:56:40 +11:00
William Desportes a66e868fd0 Merge #317 - Fix #309 QueryHistoryMax is an int 2020-12-31 11:08:11 +01:00
w3goodiesandGitHub 9322b7afdf Update config.inc.php
PMA_QUERYHISTORYMAX is integer value. Using boolval on it will either result in 1 or 0 for max query history.
2020-12-31 06:19:01 +03:00
William Desportes 0225133981 Merge #292 - Documentation fixes 2020-12-26 12:19:54 +01:00
William Desportes d6da7ca981 Wording improvement 2020-12-26 12:19:09 +01:00
William Desportes 76b8d29695 Improvements and document #309 2020-12-26 12:15:33 +01:00
Isaac BennetchandWilliam Desportes 00ad857703 Document more ENV variables that were added with https://github.com/phpmyadmin/docker/pull/152/
Related to 85198de04f and 93e2be73ec

Fixes #151

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-12-26 12:05:40 +01:00
Isaac BennetchandWilliam Desportes b2edf5d8fd Grammar fixes
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-12-26 12:05:10 +01:00
William Desportes 4b1fe4dc6f Merge #314 - Add the possibility to change max_execution_time 2020-12-26 12:02:34 +01:00
William Desportes a2b0f3a5c0 Merge #309 - Add PMA_QUERYHISTORYMAX config parameter 2020-12-26 12:01:05 +01:00
Dennis PaulandWilliam Desportes a3a4c4e0fd [+] ENV MAX_EXECUTION_TIME 2020-12-26 11:58:45 +01:00
William Desportes 06cc93a972 #313 - Drop Build Images from TravisCI 2020-12-26 11:53:10 +01:00
William Desportes 7f5e91546b Merge #305 - Add 'max_input_vars = 10000' to phpmyadmin_misc.ini 2020-12-26 11:44:14 +01:00
William Desportes 7e3ee4e83c Merge #313 - Add GitHub CI 2020-12-26 11:42:36 +01:00
William Desportes 1465223b65 Improve the README.md 2020-12-26 11:41:21 +01:00
J0WI a8ab7d86e7 Add GitHub CI 2020-11-06 22:20:42 +01:00
Samuel Denis-D'OrtunandGitHub 5e1ea11678 Add PMA_QUERYHISTORYMAX config parameter 2020-10-16 23:10:58 -04:00
Isaac Bennetch 497becb0f2 Update to 5.0.4
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-10-15 18:51:26 -04:00
Isaac Bennetch ba8ecc42f1 Update to 4.9.7
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-10-15 18:50:23 -04:00
Isaac Bennetch 3b0375d811 Release 5.0.3
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-10-10 00:18:15 -04:00
Isaac Bennetch 4f54fc3b46 Release 4.9.6
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-10-10 00:15:20 -04:00
slavik af6cdca3b6 add 'max_input_vars = 10000' to phpmyadmin_misc.ini 2020-09-24 00:37:25 -07:00
William Desportes 785cd48c48 #268 - Add instructions to download bashbrew 2020-09-03 18:23:25 +02:00
William Desportes 301a7c4d18 Merge #268 - Update generate-stackbrew-library.sh 2020-09-03 18:07:59 +02:00
William Desportes ad9f085601 Merge #303 - Fix docker hub tags page link 2020-09-03 18:07:16 +02:00
ff56a56a29 Use the docker library path for tags page
Co-authored-by: William Desportes <williamdes@wdes.fr>
2020-09-03 18:03:41 +02:00
Thomas DutrionandGitHub e3b575ca8e Fix docker hub tags page link
Fix Docker hub tags page link in README
2020-09-03 17:35:54 +02:00
William Desportes b9da1f2c54 Merge #301 - Update paths to image 2020-08-31 19:13:36 +02:00
J0WI d00506237d Update paths to image 2020-08-30 17:22:07 +02:00
William Desportes 39cec98bb5 Use fences for pseudo regex example of #297
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-07-31 23:47:13 +02:00
William Desportes 300ade5226 Merge #297 - Improve UPLOAD_LIMIT documentation 2020-07-31 23:44:12 +02:00
Thomas DecauxandGitHub 76651f53b3 Specify UPLOAD_LIMIT format
Default value format "2048Kb" will not work with Apache !
2020-07-31 15:35:37 +02:00
William Desportes 9d66e78f8a Merge #289 - Add SHA checksum when downloading a version
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-06-01 10:57:51 +02:00
William Desportes 85a642d7b3 Make sha256 fetching more strict
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-06-01 10:56:52 +02:00
J0WI 6e3aeb3adf Update generate-stackbrew-library.sh 2020-05-16 03:07:45 +02:00
William Desportes c0b2ac28f9 Merge #288 - Use same "latest" procedure as in update.sh
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-09 17:46:43 +02:00
J0WI 52d6fe4caf Use same "latest" procedure as in update.sh 2020-05-08 04:46:46 +02:00
J0WI f464cf5a67 Add SHA checksum 2020-05-08 04:44:41 +02:00
William Desportes d1f2dea243 Revert 490df186e5
This commit is no more needed because 27f6f7e5ae fixed the tag process

Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-07 09:48:08 +02:00
William Desportes 27f6f7e5ae Fix parsing each revision on generate-stackbrew-library.sh
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-07 08:50:07 +02:00
William Desportes 490df186e5 Add each variant to the tag list
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-07 08:49:31 +02:00
William Desportes d826f3a721 Merge #286 - cleanup after review for #56
Partial revert of 6b63869f1c

Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-07 08:30:07 +02:00
J0WI 12d40a0300 Cleanup according to review 2020-05-07 01:11:27 +02:00
William Desportes 48f16c0dde Update files after #285
Ref: https://github.com/phpmyadmin/docker/pull/285#issuecomment-612213968
2020-04-18 18:05:28 +02:00
Isaac BennetchandGitHub 0dbbe66eb3 Merge pull request #285 from ibennetch/webroot
Extract downloaded files directly to web root /var/www/html/
2020-04-18 11:30:12 -04:00
Isaac Bennetch 4d5c71ca6e Extract downloaded files directly to web root /var/www/html/
Fixes #277

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-04-10 16:34:27 -04:00
Isaac BennetchandGitHub 459489d8c1 Merge pull request #283 from krufab/bugfix/281-added-tzdata-package
#281 Added tzdata also to the template alpine file
2020-03-29 13:57:44 -04:00
Fabio Kruger ac3c819a69 #281 Added tzdata also to the template alpine file
Signed-off-by: Fabio Kruger <krufab@gmail.com>
2020-03-29 19:15:03 +02:00
Isaac BennetchandGitHub 34c0696109 Merge pull request #282 from krufab/bugfix/281-added-tzdata-package
#281 Added tzdata package
2020-03-28 21:26:23 -04:00
Fabio Kruger 3a9dc863e2 #281 Added tzdata package
Signed-off-by: Fabio Kruger <krufab@gmail.com>
2020-03-27 23:16:29 +01:00
Isaac Bennetch 6c9a35dc6e Release 5.0.2
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-03-21 00:44:01 -04:00
William Desportes 26be7daa0c Merge #275 - add some org.opencontainers.image.* labels
Pull-request: #275
2020-03-17 21:41:24 +01:00
William Desportes 6b63869f1c Add org.opencontainers.image.* labels
Licence: https://github.com/phpmyadmin/phpmyadmin/blob/master/composer.json
2020-03-17 21:37:29 +01:00
William Desportes a4071cd297 Merge #274 - apply some feedback from docker-library team
Pull-request: #274
2020-03-17 20:15:46 +01:00
J0WI e05baec603 Apply various minor enhancements 2020-03-17 18:16:01 +01:00
William Desportes 6cd68f9647 Fix generate-stackbrew-library.sh Maintainers format
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-01-16 23:16:05 +01:00
William Desportes 48f555eb3d Maintainer replacement
I put my name here because Michal Čihař resigned from phpMyAdmin
https://blog.cihar.com/archives/2019/05/29/spring-cleanup/
I hope this change is okay :)
[ci skip]
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-01-16 23:01:11 +01:00
Isaac Bennetch 8c9962be4f Release 5.0.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-01-07 22:07:49 -05:00
Isaac Bennetch 30fea9d2f4 Add version 4.9.4
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-01-07 22:06:55 -05:00
Isaac Bennetch c850d7ece9 Release 5.0.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-01-07 21:55:13 -05:00
Isaac Bennetch 8917fb7bc2 Update to phpMyAdmin release 5.0.0
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-01-01 22:22:25 -05:00
Isaac Bennetch 31f2bdd82c Update to phpMyAdmin release 4.9.3
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-01-01 22:14:24 -05:00
Isaac Bennetch 6d26530177 Update to phpMyAdmin release 5.0.0
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-12-26 12:20:27 -05:00
William Desportes 5d4b4dec94 Merge #259 - Improve documentation of which Docker tags we offer
Pull-request: #259
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-26 17:10:42 +01:00
William Desportes 4f88748138 Improve README.md and add a link to the main repo
[ci skip]

Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-26 13:32:14 +01:00
William Desportes b295aa6bf7 Improve README and fix PMA_HOSTS and PMA_HOST
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-26 13:27:08 +01:00
William Desportes dd2ca51984 Update files after 2313c19aed (#247)
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-26 13:21:11 +01:00
William Desportes 568e58cc53 Merge #247 - Implement *_FILE read ENV from file
Pull-request: #247
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-26 13:21:08 +01:00
Mandy SchoepandWilliam Desportes 60e766aa9e Added support for PMA_HOST_FILE and PMA_HOSTS_FILE 2019-12-26 13:17:43 +01:00
Mandy SchoepandWilliam Desportes 05d5c516d3 Fix and improve test suite 2019-12-24 11:21:35 +01:00
Mandy SchoepandWilliam Desportes 2576eb2c26 Implement loading secrets from files 2019-12-24 11:21:06 +01:00
Mandy SchoepandWilliam Desportes bf6422b6a6 Fix .gitignore, README.md and .travis.yml 2019-12-24 11:20:10 +01:00
William Desportes 8edcc52dfb Implement #192 - override config using base64 encoded config in ENVs
Closes: #192
Pull-request: #262

Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 11:13:18 +01:00
William Desportes ed101c2f39 Merge #261 - code improvements and implement UPLOAD_LIMIT
Ref: #238
Closes: #240
Closes: #239
Closes: #233
Closes: #189
Closes: #139
Closes: #241
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 11:11:23 +01:00
Isaac Bennetch fb5222a52c Improve documentation of which Docker tags we offer; standardize this list and adjust Docker Hub to match.
Closes #256, closes #231, closes #229, closes #214

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-12-23 21:01:26 -05:00
William Desportes d147a455af Remove a non existent use case
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:35:25 +01:00
William Desportes 4e2998a2c5 Fix README.md and add a comment
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:35:25 +01:00
William Desportes 44ab81b7cf Implement upload limit as an ENV value
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:35:09 +01:00
William Desportes 4b236d823a Fix README.md
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:34:46 +01:00
William Desportes 1eede2e6b4 Use PHP_INI_DIR from base image
Ref: https://hub.docker.com/_/php
2019-12-24 00:34:46 +01:00
William Desportes 7cd2b5b46f Use url.php since it is available on all versions
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:34:46 +01:00
William Desportes 62b73c11a9 Add .gitattributes file
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:34:46 +01:00
William Desportes a309c96f6a Use user and group for sessions
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:34:46 +01:00
William Desportes 78f64ee5ce Add a new ENV
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:34:46 +01:00
Patrik KernstockandIsaac Bennetch 2313c19aed Hide PHP version (#209)
Add option to hide PHP version by adding `expose_php = Off` to `php.ini` for security reasons
Co-authored-by: William Desportes <williamdes@wdes.fr>
2019-12-23 18:26:48 -05:00
William Desportes 7d8a3e5717 Improve README.md
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-23 14:26:33 +01:00
J0WIandIsaac Bennetch b696c1f43d Update to PHP 7.4 (#257)
* Update to PHP 7.4
2019-12-20 02:50:31 -05:00
William Desportes 53a793568a Merge #242 - drop opcache from cli actions
Pull-request: #242
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-11-30 18:48:28 +01:00
J0WI 43888414d6 Drop opcache from cli actions 2019-11-29 19:49:53 +01:00
Isaac Bennetch 0343ca5338 Update to phpMyAdmin release 4.9.2
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-11-23 07:11:36 -05:00
William Desportes 9d1872d753 Improve TravisCI file with steps
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-10-22 00:09:47 +02:00
William Desportes 5f2beb027a Revert "Increase limits for upload and post"
This reverts commit e9d1da4ebc.
2019-10-21 21:03:25 +02:00
William Desportes 0bd0e9a958 Merge #251 - improve/fix Travis CI file
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-10-21 21:00:58 +02:00
0X8CandGitHub 8dfcf48b25 Update .travis.yml 2019-10-17 14:14:21 +08:00
William Desportes e9d1da4ebc Increase limits for upload and post
Ref: #238
Closes: #240
Closes: #239
Closes: #233
Closes: #189
2019-09-30 19:19:06 +02:00
Isaac Bennetch f522725291 Update to phpMyAdmin release 4.9.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-09-21 10:28:42 -04:00
Isaac Bennetch a68a25c673 Fix the template file from c5174eeef9
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-09-21 10:27:28 -04:00
William Desportes 21dbdb8968 Merge #232 - Add documentation for using secrets
Pull-request: #232
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-09-06 19:47:06 +02:00
William Desportes ff0e3c994a Merge #221 - remove files and improve configuration
Pull-request: #221
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-09-06 19:38:29 +02:00
William Desportes 24d76d8e35 Merge #216 - Add generate-stackbrew-library.sh
Pull-request: #216
Ref: #56
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-09-06 09:20:54 +02:00
William Desportes d3281e86e1 Merge #234 - Fix makefile
Pull-request: #234
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-09-06 09:16:51 +02:00
ankitjain28may 6167470118 Added suggestions 2019-08-23 14:46:06 +05:30
ankitjain28may 304a628535 Fix makefile 2019-08-13 02:31:23 +05:30
David WhynotandGitHub 342c5fb3fc Add documentation for using secrets. 2019-08-08 15:37:09 -04:00
J0WI c5174eeef9 Cleanup php.ini 2019-07-11 02:19:28 +02:00
Isaac Bennetch 909eab579e Check for dependency and BASH version before running the script
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-06-08 13:40:03 -04:00
Isaac Bennetch 168df32465 Merge branch 'update-version' of git://github.com/J0WI/docker-phpmyadmin
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-06-08 13:29:50 -04:00
Isaac Bennetch 41ef7ee430 Upgrade to phpMyAdmin version 4.9.0.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-06-04 12:36:40 -04:00
William Desportes 33fc40f4a3 Merge pull-request #222 (remove .dockerignore)
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-05-22 18:37:52 +02:00
William Desportes 219e173c5e Merge pull-request #225 (clean unused files)
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-05-22 18:21:48 +02:00
J0WI f30ef539da Cleanup obsolete files 2019-05-22 16:57:57 +02:00
J0WI 036fd21c08 Remove .dockerignore 2019-04-24 19:50:44 +02:00
William DesportesandGitHub 7d35294fc5 Fixed missing accent
[ci skip]
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-04-01 15:10:11 +02:00
J0WI ca4e508924 Fix typo 2019-03-29 18:11:31 +01:00
J0WI effe2b1e80 Add generate-stackbrew-library.sh 2019-03-29 09:37:58 +01:00
J0WI e670276b37 Fetch latest version from api 2019-03-29 09:11:16 +01:00
J0WIandIsaac Bennetch 78e3cb7aba Refactor Dockerfile to support multiple variants and drop supervisord (#200)
* Refactor Dockerfile to support multiple variants and drop supervisord
* Rename run.sh to docker-entrypoint.sh
* Update tests for apache conatiner
* Fix tests in conatiner
* Fix database startup
* Update Makefile to build all variants
* Update phpMyAdmin to 4.8.4
* Rebase on top of v4.8.5
2019-03-29 03:48:30 -04:00
Isaac Bennetch a114733200 Update to version 4.8.5
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-01-25 22:52:24 -05:00
Isaac BennetchandGitHub 967db65940 Merge pull request #201 from J0WI/travis-nosudo
[Travis CI] Drop sudo and use default distro
2018-12-30 08:48:14 -05:00
Isaac Bennetch 921f2867f7 Updated version information to remove old, unsupported releases.
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-12-30 06:46:42 -07:00
Isaac BennetchandGitHub df7df179f2 Merge pull request #202 from glensc/patch-1
Add 4.8 tag to README
2018-12-30 08:37:10 -05:00
Elan RuusamäeandGitHub 0e87cd4731 readme: 4.8 tag is also present
for ones that prefer not to have unexpected version update (but patches are ok), prefer `X.Y` docker tag over `latest`.

improve wording as technically there is no 4.8 branch yet
2018-12-19 11:55:56 +02:00
Isaac Bennetch d3d7a78dae Update to version 4.8.4
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-12-10 21:21:00 -05:00
J0WI c775ef93dc Drop sudo and use default distro 2018-11-25 17:21:33 +01:00
Isaac BennetchandGitHub d2f01baf40 Merge pull request #198 from J0WI/user-and-root
Drop custom user/group and document root, change permissions on runtime, and coding style improvements.
2018-11-22 10:09:01 -05:00
Isaac BennetchandGitHub 56806ecbc7 Merge pull request #197 from J0WI/gpg-batch
Update "gpg" invocations to use "--batch"
2018-11-22 00:17:55 -05:00
J0WI 662b82d27e Drop custom user/group and document root, change permissions on runtime 2018-11-20 01:55:47 +01:00
J0WI fa5fb6c985 Update "gpg" invocations to use "--batch" 2018-11-20 00:44:44 +01:00
Michal ČihařandGitHub b1e2062fb4 Merge pull request #184 from deeky666/allow-env-var-list-spaces
Trims whitespaces in PMA_HOSTS, PMA_PORTS and PMA_VERBOSES
2018-09-01 13:21:22 +02:00
Michal ČihařandGitHub f01eddea45 Merge pull request #191 from baotongshi/patch-1
modify the /etc/phpmyadmin/* file's access right
2018-09-01 13:20:50 +02:00
Michal ČihařandGitHub 7899e91e35 Merge pull request #186 from s0m30n3/master
Specify MySQL socket file via PMA_SOCKET and PMA_SOCKETS environment …
2018-09-01 13:20:21 +02:00
Évan GoujonandGOUJON Évan 7af014ffdf Simplify $sockets testing logic
Signed-off-by: Évan Goujon <evan.goujon@gmail.com>
2018-08-31 21:51:56 +02:00
Baotong ShiandGitHub 0512d0c6b3 Update run.sh
when I start the phpMyAdmin Container, I got the below error
phpMyAdmin - Error
Failed to load phpMyAdmin configuration (./../etc/phpmyadmin/config.inc.php:3): require(): Failed opening required '/etc/phpmyadmin/config.secret.inc.php' (include_path='.:/usr/local/lib/php')

I found the access right of the config.secret.inc.php is not correct, I added the below cmd in run.sh, then build the image, It can work

chmod 644 /etc/phpmyadmin/*
2018-08-30 09:46:04 +08:00
Isaac Bennetch 17003ccf85 Update to version 4.8.3
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-08-22 10:23:38 -04:00
Évan GoujonandGOUJON Alexandre d5a587d00d Specify MySQL socket file via PMA_SOCKET and PMA_SOCKETS environment variables
Signed-off-by: Évan Goujon <evan.goujon@gmail.com>
2018-08-19 22:21:47 +02:00
Steve Müller b2409f5930 trim whitespaces in PMA_HOSTS, PMA_PORTS and PMA_VERBOSES 2018-08-03 12:30:33 +02:00
Isaac Bennetch 7a1cbfd6a3 Update to 4.8.2
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-06-22 10:32:13 -04:00
J0WIandMichal Čihař 25dde22ee9 Use MariaDB 10.2 for now 2018-06-12 21:19:53 +02:00
J0WIandMichal Čihař f0ebd7aec5 Set default_authentication_plugin and use only one container in tests 2018-06-12 21:19:53 +02:00
J0WIandMichal Čihař 98aa7b80c8 Run supervisord in CMD 2018-06-12 07:56:33 +02:00
J0WIandMichal Čihař 2d6fd72542 Use "nogroup" as group name 2018-06-12 07:55:57 +02:00
J0WIandMichal Čihař c706c520ef Enhance caching by moving trivial tasks to the end 2018-06-12 07:55:27 +02:00
J0WIandMichal Čihař 8269a39bfa Use short option style 2018-06-10 21:42:46 +02:00
J0WIandMichal Čihař c625c70fde Fix filename in rm cmd 2018-06-10 21:42:46 +02:00
J0WIandMichal Čihař 2608fbd118 Adjust gpg code to kill daemons, cutting down on race conditions 2018-06-09 14:29:11 +02:00
J0WIandMichal Čihař df45b3f76c code style 2018-06-09 14:29:11 +02:00
J0WIandMichal Čihař edf7b2a375 Fetch xz compressed archive 2018-06-09 14:29:11 +02:00
J0WIandMichal Čihař b369d770dd Remove default values from php.ini 2018-06-09 14:18:32 +02:00
Isaac Bennetch e831e55d59 Update to 4.8.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-05-24 23:43:52 -04:00
Sullivan SENECHALandMichal Čihař 7a5f742d7d Move back compress and AllowNoPassword to default configuration 2018-05-17 16:09:14 +02:00
Isaac Bennetch 316a237509 Update to 4.8.0.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-04-19 10:14:25 -04:00
Michal Čihař 44a266c45d Add missing newline escape
Signed-off-by: Michal Čihař <michal@cihar.com>
2018-04-18 08:40:37 +02:00
Michal Čihař 2fe5947116 Use more pgp keyservers to download the key
Apparently this is only way to make this reliable.

See #149

Signed-off-by: Michal Čihař <michal@cihar.com>
2018-04-18 08:22:22 +02:00
Michal Čihař 92a5a76a26 Switch to gnupg.net keyservers
The old one seem not to be accessible sometimes.

See #149

Signed-off-by: Michal Čihař <michal@cihar.com>
2018-04-18 08:08:05 +02:00
Michal ČihařandGitHub 5dd9a0f015 Merge pull request #152 from Farfaday/master
Possiblity to configure the phpMyAdmin configuration storage
2018-04-18 08:01:11 +02:00
Michal ČihařandGitHub f18aca104e Merge pull request #155 from rogervila/tempdir-fix
Avoid "TempDir is not accessible" message
2018-04-18 08:00:12 +02:00
Michal ČihařandGitHub d42e7c8a7d Merge pull request #149 from J0WI/enhancements2
Fetch GnuPG key from keyserver
2018-04-18 07:58:29 +02:00
Roger VilàandGitHub ca768f47fc Avoid "TempDir is not accessible" message
phpmyadmin should create the tmp dir for twig templates.

This is the original issue: https://github.com/phpmyadmin/phpmyadmin/issues/14172
2018-04-13 11:51:35 +02:00
Isaac Bennetch c6aee5664c Update to 4.8.0
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-04-07 11:42:13 -04:00
François Blondel 93e2be73ec check if the env is set 2018-03-21 10:55:33 +01:00
François Blondel 85198de04f Add Env Var to use an external configuration storage 2018-03-19 18:54:33 +01:00
Isaac Bennetch b024df6c3c Update to 4.7.9
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-03-05 13:21:16 -05:00
Isaac Bennetch ffedad4cdf Update to 4.7.8
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-02-20 14:29:01 -05:00
J0WI c5d83d0fba Enhance build caching 2018-02-13 03:35:25 +01:00
J0WI d5f2f27d37 Fetch GnuPG key from keyserver 2018-02-13 03:35:06 +01:00
Michal Čihař d53771b561 Bring back original SQL lookup
Issue #144

Signed-off-by: Michal Čihař <michal@cihar.com>
2018-02-12 14:48:40 +01:00
Michal Čihař 3bd49fb1ef Avoid using tabs
Issue #144

Signed-off-by: Michal Čihař <michal@cihar.com>
2018-02-12 14:47:37 +01:00
Michal Čihař d9236dfdad Merge remote-tracking branch 'origin/pull/144' 2018-02-12 14:47:07 +01:00
Michal Čihař 5e02108932 Increase fastcgi buffers
phpMyAdmin is sometimes manipulating with too many cookies to fit into
standard buffer.

Fixes #147

Signed-off-by: Michal Čihař <michal@cihar.com>
2018-02-12 14:36:08 +01:00
J0WI 3a01bacb26 Keep old path for local testing 2018-02-10 14:22:18 +01:00
J0WI c09ec0fda8 Adjust paths for tests 2018-01-03 15:15:35 +01:00
J0WI 621e3ad755 Upgrade Alpine and PHP version 2018-01-02 23:56:58 +01:00
J0WIandJ0WI c03fa82b56 Use upstream PHP FPM Alpine Docker image 2018-01-02 23:56:11 +01:00
Michal ČihařandGitHub f5644c53c8 Merge pull request #145 from nijel/alpine-3.7
Update to Alpine 3.7
2018-01-02 11:20:05 +01:00
Michal Čihař 45873ade6a Update to Alpine 3.7
Signed-off-by: Michal Čihař <michal@cihar.com>
2018-01-02 11:10:15 +01:00
Isaac Bennetch 7aa164f6e1 Update to 4.7.7
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-12-23 09:40:30 -05:00
Michal Čihař c086bcea60 Remove no longer used configuration
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-12-14 10:54:36 +01:00
Michal Čihař 885eb78b98 Set $i to last used server in configuration
This makes it easier to adjust it in config.user.inc.php.

Fixes #142

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-12-14 10:50:21 +01:00
47 changed files with 2104 additions and 2549 deletions
-7
View File
@@ -1,7 +0,0 @@
.travis.yml
docker-compose.yml
docker-compose.testing.yml
README.md
LICENSE
Makefile
testing
+1
View File
@@ -0,0 +1 @@
*.sql linguist-detectable=false
+48
View File
@@ -0,0 +1,48 @@
name: GitHub CI
on:
pull_request:
push:
schedule:
- cron: 0 0 * * 0
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
jobs:
generate-jobs:
name: Generate Jobs
runs-on: ubuntu-latest
outputs:
strategy: ${{ steps.generate-jobs.outputs.strategy }}
steps:
- uses: actions/checkout@v2
- id: generate-jobs
name: Generate Jobs
run: |
git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew
strategy="$(~/bashbrew/scripts/github-actions/generate.sh)"
jq . <<<"$strategy" # sanity check / debugging aid
echo "::set-output name=strategy::$strategy"
test:
needs: generate-jobs
strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }}
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Prepare Environment
run: ${{ matrix.runs.prepare }}
- name: Pull Dependencies
run: ${{ matrix.runs.pull }}
- name: Build ${{ matrix.name }}
run: ${{ matrix.runs.build }}
- name: History ${{ matrix.name }}
run: ${{ matrix.runs.history }}
- name: Test ${{ matrix.name }}
run: ${{ matrix.runs.test }}
- name: '"docker images"'
run: ${{ matrix.runs.images }}
+26
View File
@@ -0,0 +1,26 @@
name: Internal test suite
on:
pull_request:
push:
jobs:
test-apache-container:
name: Test on database ${{ matrix.database-image }}
runs-on: ubuntu-latest
strategy:
matrix:
database-image: ["mariadb:10.4", "mysql:5.7", "mariadb:latest", "mysql:latest"]
steps:
- uses: actions/checkout@v2
- name: Build images
run: docker-compose -f docker-compose.testing.yml build
- name: Run normal tests
run: docker-compose -f docker-compose.testing.yml up --build --abort-on-container-exit --exit-code-from=sut
env:
DB: ${{ matrix.database-image }}
- name: Run one host tests
run: docker-compose -f docker-compose.testing-one-host.yml up --build --abort-on-container-exit --exit-code-from=sut
env:
DB: ${{ matrix.database-image }}
+5
View File
@@ -1 +1,6 @@
config.secret.inc.php
__pycache__
.pytest_cache
.vscode
.history
.venv
-45
View File
@@ -1,45 +0,0 @@
dist: trusty
sudo: required
services:
- docker
language: python
python:
- "2.7"
env:
matrix:
- DB=mysql:latest
- DB=mariadb:latest
before_install:
- export TESTSUITE_PASSWORD=`openssl rand -base64 30`
- docker run --name db_server -e MYSQL_ROOT_PASSWORD=$TESTSUITE_PASSWORD -d $DB
install:
- pip install mechanize html5lib
script:
# Build image
- docker build -t phpmyadmin/phpmyadmin .
# Test for single database
- docker run --name testadmin -d --link db_server:db -p 9090:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh testadmin 9090
# Test for single database using env
- docker run --name envadmin -d --link db_server:db2 -e PMA_HOST=db2 -p 6060:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh envadmin 6060
# Test for arbitrary database
- docker run --name arbitraryadmin -d --link db_server:db3 -e PMA_ARBITRARY=1 -p 7070:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh arbitraryadmin 7070 db3
# Test for arbitrary database with user config
- docker run --name userconfigadmin -d --link db_server:db3 -v `readlink -f ./testing/config.test.inc.php`:/etc/phpmyadmin/config.user.inc.php -p 7080:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh userconfigadmin 7080 db3
# Test docker-compose
- docker-compose -f docker-compose.yml -f docker-compose.db.yml up -d
- ./testing/test-docker.sh phpmyadmin 8080 db_server
- docker-compose stop
# Run tests in testing container
- docker-compose -f docker-compose.testing.yml up -d phpmyadmin
- ./testing/wait-for-testing.sh
+54
View File
@@ -0,0 +1,54 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased] - YYYY-MM-DD
- Fix GPG keyservers in Dockerfiles
- Remove microbadger badges, it closed
- Improve the README file
- Fix add back composer.json and remove non needed source files (#345)
- Update to PHP 8.0 (#325)
## [5.1.1] - 2021-06-04
- Improve documentation
## [5.1.0] - 2021-02-24
- Set ini setting `max_input_vars = 10000`
- Add support for ENV `PMA_QUERYHISTORYMAX`
- Add support for ENV `MAX_EXECUTION_TIME`
- Move to GitHub actions
- Re-work the test system
- Support docker secrets from file for `PMA_CONTROLPASS`
- Generate phpmyadmin-misc.ini from ENVs
## [4.9.{6,7}] - 2020-10-{10,16} and [5.0.{3,4}] - 2020-10-{10,16}
- Add `tzdata` package
- Extract downloaded files directly to web root `/var/www/html/` (#277)
- Add SHA checksum when downloading a version
- Improved `UPLOAD_LIMIT` documentation
- Update documentation from `phpmyadmin/phpmyadmin` to `phpmyadmin`
- `phpmyadmin` is now the official image in the Docker official library
## [5.0.2] - 2020-03-21
- Add org.opencontainers.image.* labels
- Apply some feedback from docker-library team to Dockerfiles
## [4.9.3] - 2020-01-02 and [5.0.0] - 2019-12-26
- Add support for ENV `HIDE_PHP_VERSION` to set ini setting `expose_php = Off`
- Add support for ENV `UPLOAD_LIMIT` to set `upload_max_filesize` and `post_max_size` ini settings
- Add support for ENVs `PMA_CONFIG_BASE64` and `PMA_USER_CONFIG_BASE64` (#192)
- Support docker secrets from files for `PMA_PASSWORD`, `MYSQL_ROOT_PASSWORD` and `MYSQL_PASSWORD`
- Support docker secrets from files for `PMA_HOSTS` and `PMA_HOST`
## [4.9.2-2] - 2020-12-20
- Update to PHP 7.4 (#257)
- Drop ini setting `opcache.enable_cli=1`
-47
View File
@@ -1,47 +0,0 @@
FROM alpine:3.6
# Install dependencies
RUN apk add --no-cache php7-session php7-mysqli php7-mbstring php7-xml php7-gd php7-zlib php7-bz2 php7-zip php7-openssl php7-curl php7-opcache php7-json nginx php7-fpm supervisor
# Include keyring to verify download
COPY phpmyadmin.keyring /
# Copy configuration
COPY etc /etc/
# Copy main script
COPY run.sh /run.sh
RUN chmod u+rwx /run.sh
# Calculate download URL
ENV VERSION 4.7.6
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.gz
LABEL version=$VERSION
# Download tarball, verify it using gpg and extract
RUN set -x \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& apk add --no-cache curl gnupg \
&& curl --output phpMyAdmin.tar.gz --location $URL \
&& curl --output phpMyAdmin.tar.gz.asc --location $URL.asc \
&& gpgv --keyring /phpmyadmin.keyring phpMyAdmin.tar.gz.asc phpMyAdmin.tar.gz \
&& apk del --no-cache curl gnupg \
&& rm -rf "$GNUPGHOME" \
&& tar xzf phpMyAdmin.tar.gz \
&& rm -f phpMyAdmin.tar.gz phpMyAdmin.tar.gz.asc \
&& mv phpMyAdmin-$VERSION-all-languages /www \
&& rm -rf /www/setup/ /www/examples/ /www/test/ /www/po/ /www/composer.json /www/RELEASE-DATE-$VERSION \
&& sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /www/libraries/vendor_config.php \
&& chown -R root:nobody /www \
&& find /www -type d -exec chmod 750 {} \; \
&& find /www -type f -exec chmod 640 {} \;
# Add directory for sessions to allow session persistence
RUN mkdir /sessions
# We expose phpMyAdmin on port 80
EXPOSE 80
ENTRYPOINT [ "/run.sh" ]
CMD ["phpmyadmin"]
+115
View File
@@ -0,0 +1,115 @@
FROM php:8.0-%%VARIANT%%
# docker-entrypoint.sh dependencies
RUN apk add --no-cache \
bash \
tzdata
# Install dependencies
RUN set -ex; \
\
apk add --no-cache --virtual .build-deps \
bzip2-dev \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
libzip-dev \
; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
docker-php-ext-install -j "$(nproc)" \
bz2 \
gd \
mysqli \
opcache \
zip \
; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .phpmyadmin-phpexts-rundeps $runDeps; \
apk del --no-network .build-deps
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
ENV MAX_EXECUTION_TIME 600
ENV MEMORY_LIMIT 512M
ENV UPLOAD_LIMIT 2048K
RUN set -ex; \
\
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly=1'; \
echo 'session.use_strict_mode=1'; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen=Off'; \
echo 'max_execution_time=${MAX_EXECUTION_TIME}'; \
echo 'max_input_vars=10000'; \
echo 'memory_limit=${MEMORY_LIMIT}'; \
echo 'post_max_size=${UPLOAD_LIMIT}'; \
echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \
} > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini
# Calculate download URL
ENV VERSION %%VERSION%%
ENV SHA256 %%SHA256%%
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \
gnupg \
; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl -fsSL -o phpMyAdmin.tar.xz $URL; \
curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.openpgp.org --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /var/www/html --strip-components=1; \
mkdir -p /var/www/html/tmp; \
chown www-data:www-data /var/www/html/tmp; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -r -v /var/www/html/setup/ /var/www/html/examples/ /var/www/html/js/src/ /var/www/html/templates/test/ /var/www/html/babel.config.json /var/www/html/doc/html/_sources/ /var/www/html/RELEASE-DATE-$VERSION /var/www/html/CONTRIBUTING.md; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /var/www/html/libraries/vendor_config.php; \
apk del --no-network .fetch-deps
# Copy configuration
COPY config.inc.php /etc/phpmyadmin/config.inc.php
# Copy main script
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["%%CMD%%"]
+126
View File
@@ -0,0 +1,126 @@
FROM php:8.0-%%VARIANT%%
# Install dependencies
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libbz2-dev \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
libzip-dev \
; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
docker-php-ext-install -j "$(nproc)" \
bz2 \
gd \
mysqli \
opcache \
zip \
; \
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
ENV MAX_EXECUTION_TIME 600
ENV MEMORY_LIMIT 512M
ENV UPLOAD_LIMIT 2048K
RUN set -ex; \
\
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly=1'; \
echo 'session.use_strict_mode=1'; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen=Off'; \
echo 'max_execution_time=${MAX_EXECUTION_TIME}'; \
echo 'max_input_vars=10000'; \
echo 'memory_limit=${MEMORY_LIMIT}'; \
echo 'post_max_size=${UPLOAD_LIMIT}'; \
echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \
} > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini
# Calculate download URL
ENV VERSION %%VERSION%%
ENV SHA256 %%SHA256%%
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
gnupg \
dirmngr \
; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl -fsSL -o phpMyAdmin.tar.xz $URL; \
curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.openpgp.org --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /var/www/html --strip-components=1; \
mkdir -p /var/www/html/tmp; \
chown www-data:www-data /var/www/html/tmp; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -r -v /var/www/html/setup/ /var/www/html/examples/ /var/www/html/js/src/ /var/www/html/templates/test/ /var/www/html/babel.config.json /var/www/html/doc/html/_sources/ /var/www/html/RELEASE-DATE-$VERSION /var/www/html/CONTRIBUTING.md; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /var/www/html/libraries/vendor_config.php; \
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# Copy configuration
COPY config.inc.php /etc/phpmyadmin/config.inc.php
# Copy main script
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["%%CMD%%"]
+14 -6
View File
@@ -1,18 +1,26 @@
DOCKER_REPO = phpmyadmin/phpmyadmin
DOCKER_REPO = phpmyadmin
.PHONY: all build build_nc run logs clean stop rm prune
.PHONY: all build run logs clean stop rm prune
all: build run logs
build:
docker build -t ${DOCKER_REPO}:testing .
build: build-apache build-fpm build-fpm-alpine
build_nc:
docker build --no-cache=true -t ${DOCKER_REPO}:testing .
build-apache:
docker build ${DOCKER_FLAGS} -t ${DOCKER_REPO}:testing apache
build-fpm:
docker build ${DOCKER_FLAGS} -t ${DOCKER_REPO}:testing-fpm fpm
build-fpm-alpine:
docker build ${DOCKER_FLAGS} -t ${DOCKER_REPO}:testing-fpm-alpine fpm-alpine
run:
docker-compose -f docker-compose.testing.yml up -d
run-tests:
docker-compose exec phpmyadmin /test-docker.sh phpmyadmin_testing 80 phpmyadmin_testing_db
logs:
docker-compose -f docker-compose.testing.yml logs
+134 -56
View File
@@ -1,104 +1,142 @@
# Official phpMyAdmin Docker image
Run phpMyAdmin with Alpine, supervisor, nginx and PHP FPM.
Note that since phpMyAdmin has been accepted in to the [official DockerHub repository](https://hub.docker.com/_/phpmyadmin), you can use
either that or this older [phpMyAdmin repository](https://hub.docker.com/r/phpmyadmin/phpmyadmin/) for your Docker installation. This
is maintained as a courtesy to users who have not migrated.
[![Build Status](https://travis-ci.org/phpmyadmin/docker.svg?branch=master)](https://travis-ci.org/phpmyadmin/docker)
[![Docker Pulls](https://img.shields.io/docker/pulls/phpmyadmin/phpmyadmin.svg)][hub]
[![Docker Stars](https://img.shields.io/docker/stars/phpmyadmin/phpmyadmin.svg)][hub]
[![Docker Layers](https://images.microbadger.com/badges/image/phpmyadmin/phpmyadmin.svg)](https://microbadger.com/images/phpmyadmin/phpmyadmin "Get your own image badge on microbadger.com")
[![Docker Version](https://images.microbadger.com/badges/version/phpmyadmin/phpmyadmin.svg)](https://microbadger.com/images/phpmyadmin/phpmyadmin "Get your own version badge on microbadger.com")
Run phpMyAdmin with Alpine, Apache and PHP FPM.
[![GitHub CI build status badge](https://github.com/phpmyadmin/docker/workflows/GitHub%20CI/badge.svg)](https://github.com/phpmyadmin/docker/actions?query=workflow%3A%22GitHub+CI%22)
[![update.sh build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/phpmyadmin.svg?label=Automated%20update.sh)](https://doi-janky.infosiftr.net/job/update.sh/job/phpmyadmin/)
[![amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/amd64/job/phpmyadmin.svg?label=amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/phpmyadmin)
[![arm32v5 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/phpmyadmin.svg?label=arm32v5)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/phpmyadmin)
[![arm32v6 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/phpmyadmin.svg?label=arm32v6)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/phpmyadmin)
[![arm32v7 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/phpmyadmin.svg?label=arm32v7)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/phpmyadmin)
[![arm64v8 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/phpmyadmin.svg?label=arm64v8)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/phpmyadmin)
[![i386 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/i386/job/phpmyadmin.svg?label=i386)](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/phpmyadmin)
[![mips64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/phpmyadmin.svg?label=mips64le)](https://doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/phpmyadmin)
[![ppc64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/phpmyadmin.svg?label=ppc64le)](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/phpmyadmin)
[![s390x build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/s390x/job/phpmyadmin.svg?label=s390x)](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/phpmyadmin)
[![Docker Pulls](https://img.shields.io/docker/pulls/_/phpmyadmin.svg)][hub]
[![Docker Stars](https://img.shields.io/docker/stars/_/phpmyadmin.svg)][hub]
All following examples will bring you phpMyAdmin on `http://localhost:8080`
All of the following examples will bring you phpMyAdmin on `http://localhost:8080`
where you can enjoy your happy MySQL administration.
## Credentials
phpMyAdmin does use MySQL server credential, please check the corresponding
server image for information how it is setup.
phpMyAdmin connects using your MySQL server credentials. Please check your corresponding
database server image for information on the default username and password or how to specify your own custom credentials during installation.
The official MySQL and MariaDB use following environment variables to define these:
The official MySQL and MariaDB images use the following environment variables to define these:
* `MYSQL_ROOT_PASSWORD` - This variable is mandatory and specifies the password that will be set for the `root` superuser account.
* `MYSQL_USER`, `MYSQL_PASSWORD` - These variables are optional, used in conjunction to create a new user and to set that user's password.
## Docker hub tags
## Supported Docker Hub tags
You can use following tags on Docker hub:
The following tags are available:
* `latest` - latest stable release
* `4.6` - latest stable release from the 4.6 branch
* `4.7` - latest stable release from the 4.7 branch
* `edge` - bleeding edge docker image (contains stable phpMyAdmin, but the Docker image changes might not yet be fully tested)
* `edge-4.7` - bleeding edge docker image + latest snapshots from 4.7 branch
* `edge-4.8` - bleeding edge docker image + latest snapshots from 4.8 branch (currently master)
* `latest`, `fpm`, and `fpm-alpine` are always the most recent released version
* Major versions, such as `5`, `5-fpm`, and `5-fpm-alpine`
* Specific minor versions, such as `5.0`, `5.0-fpm`, and `5-fpm-alpine`
* Specific patch versions, such as `5.0.0`, `5.0.0-fpm`, and `5.0.0-alpine`. Note that, on rare occasion, there may be an intermediary "docker-only" release, such as 4.9.2-1
A complete list of tags is [available at Docker Hub](https://hub.docker.com/_/phpmyadmin?tab=tags)
## Image variants
We provide three variations:
* "apache" includes a full Apache webserver with PHP and includes everything needed to work out of the box.
This is the default when only a version number is requested.
* "fpm" only starts a PHP FPM container. Use this variant if you already have a separate webserver.
This includes more tools and is therefore a larger image than the "fpm-alpine" variation.
* "fpm-alpine" has a very small footprint. It is based on Alpine Linux and only starts a PHP FPM process.
Use this variant if you already have a separate webserver. If you need more tools that are not available on Alpine Linux, use the fpm image instead.
## Usage with linked server
First you need to run MySQL or MariaDB server in Docker, and this image need
link a running mysql instance container:
First you need to run a MySQL or MariaDB server in Docker, and the phpMyAdmin image needs to be
linked to the running database container:
```
docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 phpmyadmin/phpmyadmin
```sh
docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 phpmyadmin
```
## Usage with external server
You can specify MySQL host in the `PMA_HOST` environment variable. You can also
use `PMA_PORT` to specify port of the server in case it's not the default one:
You can specify a MySQL host in the `PMA_HOST` environment variable. You can also
use `PMA_PORT` to specify the port of the server in case it's not the default one:
```
docker run --name myadmin -d -e PMA_HOST=dbhost -p 8080:80 phpmyadmin/phpmyadmin
```sh
docker run --name myadmin -d -e PMA_HOST=dbhost -p 8080:80 phpmyadmin
```
## Usage with arbitrary server
You can use arbitrary servers by adding ENV variable `PMA_ARBITRARY=1` to the startup command:
You can use arbitrary servers by adding the environment variable `PMA_ARBITRARY=1` to the startup command:
```
docker run --name myadmin -d -e PMA_ARBITRARY=1 -p 8080:80 phpmyadmin/phpmyadmin
```sh
docker run --name myadmin -d -e PMA_ARBITRARY=1 -p 8080:80 phpmyadmin
```
## Usage with docker-compose and arbitrary server
This will run phpMyAdmin with arbitrary server - allowing you to specify MySQL/MariaDB
server on login page.
This will run phpMyAdmin with the arbitrary server option - allowing you to specify any MySQL/MariaDB
server on the login page.
Using the docker-compose.yml from https://github.com/phpmyadmin/docker
```yaml
version: '3.1'
```
docker-compose up -d
```
services:
db:
image: mariadb:10.3
restart: always
environment:
MYSQL_ROOT_PASSWORD: notSecureChangeMe
## Run the E2E tests with docker-compose
You can run the E2E tests with the local test environment by running MariaDB/MySQL databases. Adding ENV variable `PHPMYADMIN_RUN_TEST=true` already added on docker-compose file. Simply run:
Using the docker-compose.testing.yml from https://github.com/phpmyadmin/docker
```
docker-compose -f docker-compose.testing.yml up phpmyadmin
phpmyadmin:
image: phpmyadmin
restart: always
ports:
- 8080:80
environment:
- PMA_ARBITRARY=1
```
## Adding Custom Configuration
You can add your own custom config.inc.php settings (such as Configuration Storage setup)
by creating a file named "config.user.inc.php" with the various user defined settings
You can add your own custom config.inc.php settings (such as Configuration Storage setup)
by creating a file named `config.user.inc.php` with the various user defined settings
in it, and then linking it into the container using:
```
```sh
-v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php
```
On the "docker run" line like this:
```
docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php phpmyadmin/phpmyadmin
On the `docker run` line like this:
```sh
docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php phpmyadmin
```
See the following links for config file information.
https://docs.phpmyadmin.net/en/latest/config.html#config
https://docs.phpmyadmin.net/en/latest/setup.html
Be sure to have `<?php` as your first line of the configuration file or the contents will not be detected as PHP code.
## Usage behind reverse proxys
Example:
```php
<?php
$cfg['ShowPhpInfo'] = true; // Adds a link to phpinfo() on the home page
```
See the following links for config file information:
* https://docs.phpmyadmin.net/en/latest/config.html#config
* https://docs.phpmyadmin.net/en/latest/setup.html
## Usage behind a reverse proxy
Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma.example.net/``) where the reverse proxy makes phpMyAdmin available.
@@ -111,11 +149,51 @@ Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma
* ``PMA_HOSTS`` - define comma separated list of address/host names of the MySQL servers
* ``PMA_VERBOSES`` - define comma separated list of verbose names of the MySQL servers
* ``PMA_PORTS`` - define comma separated list of ports of the MySQL servers
* ``PMA_USER`` and ``PMA_PASSWORD`` - define username to use for config authentication method
* ``PMA_ABSOLUTE_URI`` - define user-facing URI
* ``PMA_USER`` and ``PMA_PASSWORD`` - define username and password to use only with the `config` authentication method
* ``PMA_ABSOLUTE_URI`` - the full URL to phpMyAdmin. Sometimes needed when used in a reverse-proxy configuration. Don't set this unless needed. See [documentation](https://docs.phpmyadmin.net/en/latest/config.html#cfg_PmaAbsoluteUri).
* ``PMA_CONFIG_BASE64`` - if set, this option will override the default `config.inc.php` with the base64 decoded contents of the variable
* ``PMA_USER_CONFIG_BASE64`` - if set, this option will override the default `config.user.inc.php` with the base64 decoded contents of the variable
* ``PMA_CONTROLHOST`` - when set, this points to an alternate database host used for storing the [phpMyAdmin Configuration Storage database](https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage) database
* ``PMA_CONTROLPORT`` - if set, will override the default port (3306) for connecting to the control host for storing the [phpMyAdmin Configuration Storage database](https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage) database
* ``PMA_PMADB`` - define the name of the database to be used for the [phpMyAdmin Configuration Storage database](https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage). When not set, the advanced features are not enabled by default (they can still potentially be enabled by the user when logging in with the zero conf (zero configuration) feature. Suggested values: `phpmyadmin` or `pmadb`
* ``PMA_CONTROLUSER`` - define the username for phpMyAdmin to use for advanced features (the [controluser](https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_controluser))
* ``PMA_CONTROLPASS`` - define the password for phpMyAdmin to use with the [controluser](https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_controlpass)
* ``PMA_QUERYHISTORYDB`` - when set [to true](https://docs.phpmyadmin.net/en/latest/config.html#cfg_QueryHistoryDB), enables storing [SQL history](https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_history) to the [phpMyAdmin Configuration Storage database](https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage). When [false](https://docs.phpmyadmin.net/en/latest/config.html#cfg_QueryHistoryDB), history is stored in the browser and is cleared when logging out
* ``PMA_QUERYHISTORYMAX`` - when set to an integer, controls the number of history items. See [documentation](https://docs.phpmyadmin.net/en/latest/config.html#cfg_QueryHistoryMax). Defaults to `25`.
* ``MAX_EXECUTION_TIME`` - if set, will override the maximum execution time in seconds (default 600) for phpMyAdmin ([$cfg['ExecTimeLimit']](https://docs.phpmyadmin.net/en/latest/config.html#cfg_ExecTimeLimit)) and PHP [max_execution_time](https://www.php.net/manual/en/info.configuration.php#ini.max-execution-time) (format as `[0-9+]`)
* ``MEMORY_LIMIT`` - if set, will override the memory limit (default 512M) for phpMyAdmin ([$cfg['MemoryLimit']](https://docs.phpmyadmin.net/en/latest/config.html#cfg_MemoryLimit)) and PHP [memory_limit](https://www.php.net/manual/en/ini.core.php#ini.memory-limit) (format as `[0-9+](K,M,G)` where K is for Kilobytes, M for Megabytes, G for Gigabytes and 1K = 1024 bytes)
* ``UPLOAD_LIMIT`` - if set, this option will override the default value for apache and php-fpm (format as `[0-9+](K,M,G)` default value is 2048K, this will change ``upload_max_filesize`` and ``post_max_size`` values)
* ``HIDE_PHP_VERSION`` - if defined, this option will hide the PHP version (`expose_php = Off`). Set to any value (such as `HIDE_PHP_VERSION=true`).
For usage with Docker secrets, appending ``_FILE`` to the ``PMA_PASSWORD`` environment variable is allowed (it overrides ``PMA_PASSWORD`` if it is set):
```sh
docker run --name myadmin -d -e PMA_PASSWORD_FILE=/run/secrets/db_password.txt -p 8080:80 phpmyadmin
```
#### Variables that can be read from a file using ``_FILE``
- `PMA_PASSWORD`
- `MYSQL_ROOT_PASSWORD`
- `MYSQL_PASSWORD`
- `PMA_HOSTS`
- `PMA_HOST`
- `PMA_CONTROLPASS`
## Run the E2E tests with docker-compose
You can run the E2E tests with the local test environment by running MariaDB/MySQL databases. Adding ENV variable `PHPMYADMIN_RUN_TEST=true` already added on docker-compose file. Simply run:
Using the docker-compose.testing.yml from https://github.com/phpmyadmin/docker
```sh
docker-compose -f docker-compose.testing.yml up phpmyadmin
```
For more detailed documentation see https://docs.phpmyadmin.net/en/latest/setup.html#installing-using-docker
[hub]: https://hub.docker.com/r/phpmyadmin/phpmyadmin/
[hub]: https://hub.docker.com/_/phpmyadmin
Please report any issues with the Docker container to https://github.com/phpmyadmin/docker/issues
Please report any issues with phpMyAdmin to https://github.com/phpmyadmin/phpmyadmin/issues
+126
View File
@@ -0,0 +1,126 @@
FROM php:8.0-apache
# Install dependencies
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libbz2-dev \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
libzip-dev \
; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
docker-php-ext-install -j "$(nproc)" \
bz2 \
gd \
mysqli \
opcache \
zip \
; \
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
ENV MAX_EXECUTION_TIME 600
ENV MEMORY_LIMIT 512M
ENV UPLOAD_LIMIT 2048K
RUN set -ex; \
\
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly=1'; \
echo 'session.use_strict_mode=1'; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen=Off'; \
echo 'max_execution_time=${MAX_EXECUTION_TIME}'; \
echo 'max_input_vars=10000'; \
echo 'memory_limit=${MEMORY_LIMIT}'; \
echo 'post_max_size=${UPLOAD_LIMIT}'; \
echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \
} > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini
# Calculate download URL
ENV VERSION 5.1.3
ENV SHA256 c562feddc0f8ff5e69629113f273a0d024a65fb928c48e89ce614744d478296f
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
gnupg \
dirmngr \
; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl -fsSL -o phpMyAdmin.tar.xz $URL; \
curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.openpgp.org --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /var/www/html --strip-components=1; \
mkdir -p /var/www/html/tmp; \
chown www-data:www-data /var/www/html/tmp; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -r -v /var/www/html/setup/ /var/www/html/examples/ /var/www/html/js/src/ /var/www/html/templates/test/ /var/www/html/babel.config.json /var/www/html/doc/html/_sources/ /var/www/html/RELEASE-DATE-$VERSION /var/www/html/CONTRIBUTING.md; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /var/www/html/libraries/vendor_config.php; \
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# Copy configuration
COPY config.inc.php /etc/phpmyadmin/config.inc.php
# Copy main script
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["apache2-foreground"]
+152
View File
@@ -0,0 +1,152 @@
<?php
require('/etc/phpmyadmin/config.secret.inc.php');
/* Ensure we got the environment */
$vars = array(
'PMA_ARBITRARY',
'PMA_HOST',
'PMA_HOSTS',
'PMA_VERBOSE',
'PMA_VERBOSES',
'PMA_PORT',
'PMA_PORTS',
'PMA_SOCKET',
'PMA_SOCKETS',
'PMA_USER',
'PMA_PASSWORD',
'PMA_ABSOLUTE_URI',
'PMA_CONTROLHOST',
'PMA_CONTROLPORT',
'PMA_PMADB',
'PMA_CONTROLUSER',
'PMA_CONTROLPASS',
'PMA_QUERYHISTORYDB',
'PMA_QUERYHISTORYMAX',
'MAX_EXECUTION_TIME',
'MEMORY_LIMIT'
);
foreach ($vars as $var) {
$env = getenv($var);
if (!isset($_ENV[$var]) && $env !== false) {
$_ENV[$var] = $env;
}
}
if (isset($_ENV['PMA_QUERYHISTORYDB'])) {
$cfg['QueryHistoryDB'] = boolval($_ENV['PMA_QUERYHISTORYDB']);
}
if (isset($_ENV['PMA_QUERYHISTORYMAX'])) {
$cfg['QueryHistoryMax'] = intval($_ENV['PMA_QUERYHISTORYMAX']);
}
/* Arbitrary server connection */
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
$cfg['AllowArbitraryServer'] = true;
}
/* Play nice behind reverse proxys */
if (isset($_ENV['PMA_ABSOLUTE_URI'])) {
$cfg['PmaAbsoluteUri'] = trim($_ENV['PMA_ABSOLUTE_URI']);
}
/* Figure out hosts */
/* Fallback to default linked */
$hosts = array('db');
/* Set by environment */
if (!empty($_ENV['PMA_HOST'])) {
$hosts = array($_ENV['PMA_HOST']);
$verbose = array($_ENV['PMA_VERBOSE']);
$ports = array($_ENV['PMA_PORT']);
} elseif (!empty($_ENV['PMA_HOSTS'])) {
$hosts = array_map('trim', explode(',', $_ENV['PMA_HOSTS']));
$verbose = array_map('trim', explode(',', $_ENV['PMA_VERBOSES']));
$ports = array_map('trim', explode(',', $_ENV['PMA_PORTS']));
}
if (!empty($_ENV['PMA_SOCKET'])) {
$sockets = array($_ENV['PMA_SOCKET']);
} elseif (!empty($_ENV['PMA_SOCKETS'])) {
$sockets = explode(',', $_ENV['PMA_SOCKETS']);
}
/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
$cfg['Servers'][$i]['host'] = $hosts[$i - 1];
if (isset($verbose[$i - 1])) {
$cfg['Servers'][$i]['verbose'] = $verbose[$i - 1];
}
if (isset($ports[$i - 1])) {
$cfg['Servers'][$i]['port'] = $ports[$i - 1];
}
if (isset($_ENV['PMA_USER'])) {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = $_ENV['PMA_USER'];
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : '';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
if (isset($_ENV['PMA_PMADB'])) {
$cfg['Servers'][$i]['pmadb'] = $_ENV['PMA_PMADB'];
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
}
if (isset($_ENV['PMA_CONTROLHOST'])) {
$cfg['Servers'][$i]['controlhost'] = $_ENV['PMA_CONTROLHOST'];
}
if (isset($_ENV['PMA_CONTROLPORT'])) {
$cfg['Servers'][$i]['controlport'] = $_ENV['PMA_CONTROLPORT'];
}
if (isset($_ENV['PMA_CONTROLUSER'])) {
$cfg['Servers'][$i]['controluser'] = $_ENV['PMA_CONTROLUSER'];
}
if (isset($_ENV['PMA_CONTROLPASS'])) {
$cfg['Servers'][$i]['controlpass'] = $_ENV['PMA_CONTROLPASS'];
}
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
}
for ($i = 1; isset($sockets[$i - 1]); $i++) {
$cfg['Servers'][$i]['socket'] = $sockets[$i - 1];
$cfg['Servers'][$i]['host'] = 'localhost';
}
/*
* Revert back to last configured server to make
* it easier in config.user.inc.php
*/
$i--;
/* Uploads setup */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];
}
if (isset($_ENV['MEMORY_LIMIT'])) {
$cfg['MemoryLimit'] = $_ENV['MEMORY_LIMIT'];
}
/* Include User Defined Settings Hook */
if (file_exists('/etc/phpmyadmin/config.user.inc.php')) {
include('/etc/phpmyadmin/config.user.inc.php');
}
+50
View File
@@ -0,0 +1,50 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
EOT
fi
if [ ! -f /etc/phpmyadmin/config.user.inc.php ]; then
touch /etc/phpmyadmin/config.user.inc.php
fi
fi
if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo "PHP version is now hidden."
echo -e 'expose_php = Off\n' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi
if [ ! -z "${PMA_CONFIG_BASE64}" ]; then
echo "Adding the custom config.inc.php from base64."
echo "${PMA_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.inc.php
fi
if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "Adding the custom config.user.inc.php from base64."
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
# Check if the variable with name $env_var_file (which is $PMA_PASSWORD_FILE for example)
# is not empty and export $PMA_PASSWORD as the password in the Docker secrets file
if [[ -n "${!env_var_file}" ]]; then
export "${env_var}"="$(cat "${!env_var_file}")"
fi
}
get_docker_secret PMA_PASSWORD
get_docker_secret MYSQL_ROOT_PASSWORD
get_docker_secret MYSQL_PASSWORD
get_docker_secret PMA_HOSTS
get_docker_secret PMA_HOST
get_docker_secret PMA_CONTROLPASS
exec "$@"
+152
View File
@@ -0,0 +1,152 @@
<?php
require('/etc/phpmyadmin/config.secret.inc.php');
/* Ensure we got the environment */
$vars = array(
'PMA_ARBITRARY',
'PMA_HOST',
'PMA_HOSTS',
'PMA_VERBOSE',
'PMA_VERBOSES',
'PMA_PORT',
'PMA_PORTS',
'PMA_SOCKET',
'PMA_SOCKETS',
'PMA_USER',
'PMA_PASSWORD',
'PMA_ABSOLUTE_URI',
'PMA_CONTROLHOST',
'PMA_CONTROLPORT',
'PMA_PMADB',
'PMA_CONTROLUSER',
'PMA_CONTROLPASS',
'PMA_QUERYHISTORYDB',
'PMA_QUERYHISTORYMAX',
'MAX_EXECUTION_TIME',
'MEMORY_LIMIT'
);
foreach ($vars as $var) {
$env = getenv($var);
if (!isset($_ENV[$var]) && $env !== false) {
$_ENV[$var] = $env;
}
}
if (isset($_ENV['PMA_QUERYHISTORYDB'])) {
$cfg['QueryHistoryDB'] = boolval($_ENV['PMA_QUERYHISTORYDB']);
}
if (isset($_ENV['PMA_QUERYHISTORYMAX'])) {
$cfg['QueryHistoryMax'] = intval($_ENV['PMA_QUERYHISTORYMAX']);
}
/* Arbitrary server connection */
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
$cfg['AllowArbitraryServer'] = true;
}
/* Play nice behind reverse proxys */
if (isset($_ENV['PMA_ABSOLUTE_URI'])) {
$cfg['PmaAbsoluteUri'] = trim($_ENV['PMA_ABSOLUTE_URI']);
}
/* Figure out hosts */
/* Fallback to default linked */
$hosts = array('db');
/* Set by environment */
if (!empty($_ENV['PMA_HOST'])) {
$hosts = array($_ENV['PMA_HOST']);
$verbose = array($_ENV['PMA_VERBOSE']);
$ports = array($_ENV['PMA_PORT']);
} elseif (!empty($_ENV['PMA_HOSTS'])) {
$hosts = array_map('trim', explode(',', $_ENV['PMA_HOSTS']));
$verbose = array_map('trim', explode(',', $_ENV['PMA_VERBOSES']));
$ports = array_map('trim', explode(',', $_ENV['PMA_PORTS']));
}
if (!empty($_ENV['PMA_SOCKET'])) {
$sockets = array($_ENV['PMA_SOCKET']);
} elseif (!empty($_ENV['PMA_SOCKETS'])) {
$sockets = explode(',', $_ENV['PMA_SOCKETS']);
}
/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
$cfg['Servers'][$i]['host'] = $hosts[$i - 1];
if (isset($verbose[$i - 1])) {
$cfg['Servers'][$i]['verbose'] = $verbose[$i - 1];
}
if (isset($ports[$i - 1])) {
$cfg['Servers'][$i]['port'] = $ports[$i - 1];
}
if (isset($_ENV['PMA_USER'])) {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = $_ENV['PMA_USER'];
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : '';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
if (isset($_ENV['PMA_PMADB'])) {
$cfg['Servers'][$i]['pmadb'] = $_ENV['PMA_PMADB'];
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
}
if (isset($_ENV['PMA_CONTROLHOST'])) {
$cfg['Servers'][$i]['controlhost'] = $_ENV['PMA_CONTROLHOST'];
}
if (isset($_ENV['PMA_CONTROLPORT'])) {
$cfg['Servers'][$i]['controlport'] = $_ENV['PMA_CONTROLPORT'];
}
if (isset($_ENV['PMA_CONTROLUSER'])) {
$cfg['Servers'][$i]['controluser'] = $_ENV['PMA_CONTROLUSER'];
}
if (isset($_ENV['PMA_CONTROLPASS'])) {
$cfg['Servers'][$i]['controlpass'] = $_ENV['PMA_CONTROLPASS'];
}
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
}
for ($i = 1; isset($sockets[$i - 1]); $i++) {
$cfg['Servers'][$i]['socket'] = $sockets[$i - 1];
$cfg['Servers'][$i]['host'] = 'localhost';
}
/*
* Revert back to last configured server to make
* it easier in config.user.inc.php
*/
$i--;
/* Uploads setup */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];
}
if (isset($_ENV['MEMORY_LIMIT'])) {
$cfg['MemoryLimit'] = $_ENV['MEMORY_LIMIT'];
}
/* Include User Defined Settings Hook */
if (file_exists('/etc/phpmyadmin/config.user.inc.php')) {
include('/etc/phpmyadmin/config.user.inc.php');
}
-3
View File
@@ -1,3 +0,0 @@
phpmyadmin:
external_links:
- db_server:db
+69
View File
@@ -0,0 +1,69 @@
version: "3.1"
services:
db_server:
image: ${DB:-mariadb:10.3}
container_name: phpmyadmin_testing_db
environment:
MYSQL_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-uroot", "-p${TESTSUITE_PASSWORD:-my-secret-pw}"]
start_period: 5s
interval: 5s
timeout: 60s
retries: 10
networks:
testing:
volumes:
- ./testing/testing.cnf:/etc/mysql/conf.d/testing.cnf:ro
tmpfs:
- /var/lib/mysql:rw,noexec,nosuid,size=300m
phpmyadmin:
build:
context: apache
container_name: phpmyadmin_testing_apache
environment:
PMA_HOST: db_server
UPLOAD_LIMIT: 123M
MAX_EXECUTION_TIME: 125
HIDE_PHP_VERSION: 1
volumes:
- ./testing/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php
healthcheck:
test: ["CMD", "curl", "-Ss", "http://localhost/robots.txt"]
start_period: 5s
interval: 3s
timeout: 60s
retries: 10
networks:
testing:
depends_on:
db_server:
condition: service_healthy
sut:
depends_on:
phpmyadmin:
condition: service_healthy
db_server:
condition: service_healthy
build:
context: testing
command: "/tests/testing/test-docker.sh"
networks:
testing:
environment:
TESTSUITE_HOSTNAME: phpmyadmin_testing_apache
TESTSUITE_PORT: 80
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
PMA_HOST: phpmyadmin_testing_db
PMA_PORT: 3306
volumes:
- ./:/tests:ro
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /tests
networks:
testing:
driver: bridge
+61 -21
View File
@@ -1,29 +1,69 @@
version: '2'
version: "3.1"
services:
mariadb:
image: mariadb:latest
container_name: phpmyadmin_testing_mariadb
db_server:
image: ${DB:-mariadb:10.3}
container_name: phpmyadmin_testing_db
environment:
- MYSQL_ROOT_PASSWORD=test123
mysql:
image: mysql:latest
container_name: phpmyadmin_testing_mysql
environment:
- MYSQL_ROOT_PASSWORD=test123
MYSQL_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-uroot", "-p${TESTSUITE_PASSWORD:-my-secret-pw}"]
start_period: 5s
interval: 5s
timeout: 60s
retries: 10
networks:
testing:
volumes:
- ./testing/testing.cnf:/etc/mysql/conf.d/testing.cnf:ro
tmpfs:
- /var/lib/mysql:rw,noexec,nosuid,size=300m
phpmyadmin:
build:
context: testing/
container_name: phpmyadmin_testing
volumes:
- /sessions
ports:
- 8090:80
context: apache
container_name: phpmyadmin_testing_apache
environment:
- PMA_ARBITRARY=1
- TESTSUITE_PASSWORD=test123
PMA_ARBITRARY: 1
UPLOAD_LIMIT: 123M
MAX_EXECUTION_TIME: 125
HIDE_PHP_VERSION: 1
volumes:
- ./testing/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php
healthcheck:
test: ["CMD", "curl", "-Ss", "http://localhost/robots.txt"]
start_period: 5s
interval: 3s
timeout: 60s
retries: 10
networks:
testing:
depends_on:
- mariadb
- mysql
db_server:
condition: service_healthy
sut:
depends_on:
phpmyadmin:
condition: service_healthy
db_server:
condition: service_healthy
build:
context: testing
command: "/tests/testing/test-docker.sh"
networks:
testing:
environment:
TESTSUITE_HOSTNAME_ARBITRARY: 1
TESTSUITE_HOSTNAME: phpmyadmin_testing_apache
PMA_HOST: phpmyadmin_testing_db
TESTSUITE_PORT: 80
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
volumes:
- ./:/tests:ro
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /tests
networks:
testing:
driver: bridge
+1 -1
View File
@@ -1,5 +1,5 @@
phpmyadmin:
image: phpmyadmin/phpmyadmin
image: phpmyadmin
container_name: phpmyadmin
environment:
- PMA_ARBITRARY=1
+50
View File
@@ -0,0 +1,50 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
EOT
fi
if [ ! -f /etc/phpmyadmin/config.user.inc.php ]; then
touch /etc/phpmyadmin/config.user.inc.php
fi
fi
if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo "PHP version is now hidden."
echo -e 'expose_php = Off\n' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi
if [ ! -z "${PMA_CONFIG_BASE64}" ]; then
echo "Adding the custom config.inc.php from base64."
echo "${PMA_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.inc.php
fi
if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "Adding the custom config.user.inc.php from base64."
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
# Check if the variable with name $env_var_file (which is $PMA_PASSWORD_FILE for example)
# is not empty and export $PMA_PASSWORD as the password in the Docker secrets file
if [[ -n "${!env_var_file}" ]]; then
export "${env_var}"="$(cat "${!env_var_file}")"
fi
}
get_docker_secret PMA_PASSWORD
get_docker_secret MYSQL_ROOT_PASSWORD
get_docker_secret MYSQL_PASSWORD
get_docker_secret PMA_HOSTS
get_docker_secret PMA_HOST
get_docker_secret PMA_CONTROLPASS
exec "$@"
-130
View File
@@ -1,130 +0,0 @@
user nobody;
worker_processes 4;
daemon off;
pid /nginx.pid;
error_log /var/log/nginx-error.log;
events {
worker_connections 1024;
}
http {
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
}
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
client_body_timeout 12;
client_header_timeout 12;
keepalive_timeout 15;
send_timeout 10;
server_tokens off;
client_body_buffer_size 512K;
client_body_temp_path /var/nginx/client_body_temp;
client_header_buffer_size 16k;
client_max_body_size 512M;
large_client_header_buffers 4 8k;
gzip on;
gzip_comp_level 2;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/x-javascript text/xml text/css application/xml;
access_log off;
server {
listen 80 default_server;
server_name _;
root /www;
index index.php index.html index.htm;
charset utf-8;
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 405;
}
location / {
try_files $uri $uri/ =404;
}
location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
expires 365d;
}
location ~ \.php$ {
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: https://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_read_timeout 1200;
fastcgi_buffering off;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
}
location ~ /\. {
deny all;
}
location ~ /(libraries|templates) {
deny all;
}
}
}
-17
View File
@@ -1,17 +0,0 @@
[global]
error_log = /var/log/php-fpm.log
log_level = warning
[www]
user = nobody
group = nobody
listen = /var/run/php/php-fpm.sock
listen.mode = 0660
chdir = /www
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
catch_workers_output = Yes
clear_env = No
-1918
View File
File diff suppressed because it is too large Load Diff
-79
View File
@@ -1,79 +0,0 @@
<?php
require('/etc/phpmyadmin/config.secret.inc.php');
/* Ensure we got the environment */
$vars = array(
'PMA_ARBITRARY',
'PMA_HOST',
'PMA_HOSTS',
'PMA_VERBOSE',
'PMA_VERBOSES',
'PMA_PORT',
'PMA_PORTS',
'PMA_USER',
'PMA_PASSWORD',
'PMA_ABSOLUTE_URI'
);
foreach ($vars as $var) {
$env = getenv($var);
if (!isset($_ENV[$var]) && $env !== false) {
$_ENV[$var] = $env;
}
}
/* Arbitrary server connection */
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
$cfg['AllowArbitraryServer'] = true;
}
/* Play nice behind reverse proxys */
if (isset($_ENV['PMA_ABSOLUTE_URI'])) {
$cfg['PmaAbsoluteUri'] = trim($_ENV['PMA_ABSOLUTE_URI']);
}
/* Figure out hosts */
/* Fallback to default linked */
$hosts = array('db');
/* Set by environment */
if (!empty($_ENV['PMA_HOST'])) {
$hosts = array($_ENV['PMA_HOST']);
$verbose = array($_ENV['PMA_VERBOSE']);
$ports = array($_ENV['PMA_PORT']);
} elseif (!empty($_ENV['PMA_HOSTS'])) {
$hosts = explode(',', $_ENV['PMA_HOSTS']);
$verbose = explode(',', $_ENV['PMA_VERBOSES']);
$ports = explode(',', $_ENV['PMA_PORTS']);
}
/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
$cfg['Servers'][$i]['host'] = $hosts[$i - 1];
if (isset($verbose[$i - 1])) {
$cfg['Servers'][$i]['verbose'] = $verbose[$i - 1];
}
if (isset($ports[$i - 1])) {
$cfg['Servers'][$i]['port'] = $ports[$i - 1];
}
if (isset($_ENV['PMA_USER'])) {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = $_ENV['PMA_USER'];
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : '';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
}
/* Uploads setup */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
/* Include User Defined Settings Hook */
if (file_exists('/etc/phpmyadmin/config.user.inc.php')) {
include('/etc/phpmyadmin/config.user.inc.php');
}
-12
View File
@@ -1,12 +0,0 @@
[program:nginx]
command=nginx -c /etc/nginx.conf
autostart=true
autorestart=true
priority=2
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
-13
View File
@@ -1,13 +0,0 @@
[program:php-fpm]
command=php-fpm7 --nodaemonize --fpm-config /etc/php-fpm.conf -c /etc/php.ini
user=nobody
autostart=true
autorestart=true
priority=1
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
+115
View File
@@ -0,0 +1,115 @@
FROM php:8.0-fpm-alpine
# docker-entrypoint.sh dependencies
RUN apk add --no-cache \
bash \
tzdata
# Install dependencies
RUN set -ex; \
\
apk add --no-cache --virtual .build-deps \
bzip2-dev \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
libzip-dev \
; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
docker-php-ext-install -j "$(nproc)" \
bz2 \
gd \
mysqli \
opcache \
zip \
; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .phpmyadmin-phpexts-rundeps $runDeps; \
apk del --no-network .build-deps
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
ENV MAX_EXECUTION_TIME 600
ENV MEMORY_LIMIT 512M
ENV UPLOAD_LIMIT 2048K
RUN set -ex; \
\
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly=1'; \
echo 'session.use_strict_mode=1'; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen=Off'; \
echo 'max_execution_time=${MAX_EXECUTION_TIME}'; \
echo 'max_input_vars=10000'; \
echo 'memory_limit=${MEMORY_LIMIT}'; \
echo 'post_max_size=${UPLOAD_LIMIT}'; \
echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \
} > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini
# Calculate download URL
ENV VERSION 5.1.3
ENV SHA256 c562feddc0f8ff5e69629113f273a0d024a65fb928c48e89ce614744d478296f
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \
gnupg \
; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl -fsSL -o phpMyAdmin.tar.xz $URL; \
curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.openpgp.org --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /var/www/html --strip-components=1; \
mkdir -p /var/www/html/tmp; \
chown www-data:www-data /var/www/html/tmp; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -r -v /var/www/html/setup/ /var/www/html/examples/ /var/www/html/js/src/ /var/www/html/templates/test/ /var/www/html/babel.config.json /var/www/html/doc/html/_sources/ /var/www/html/RELEASE-DATE-$VERSION /var/www/html/CONTRIBUTING.md; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /var/www/html/libraries/vendor_config.php; \
apk del --no-network .fetch-deps
# Copy configuration
COPY config.inc.php /etc/phpmyadmin/config.inc.php
# Copy main script
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["php-fpm"]
+152
View File
@@ -0,0 +1,152 @@
<?php
require('/etc/phpmyadmin/config.secret.inc.php');
/* Ensure we got the environment */
$vars = array(
'PMA_ARBITRARY',
'PMA_HOST',
'PMA_HOSTS',
'PMA_VERBOSE',
'PMA_VERBOSES',
'PMA_PORT',
'PMA_PORTS',
'PMA_SOCKET',
'PMA_SOCKETS',
'PMA_USER',
'PMA_PASSWORD',
'PMA_ABSOLUTE_URI',
'PMA_CONTROLHOST',
'PMA_CONTROLPORT',
'PMA_PMADB',
'PMA_CONTROLUSER',
'PMA_CONTROLPASS',
'PMA_QUERYHISTORYDB',
'PMA_QUERYHISTORYMAX',
'MAX_EXECUTION_TIME',
'MEMORY_LIMIT'
);
foreach ($vars as $var) {
$env = getenv($var);
if (!isset($_ENV[$var]) && $env !== false) {
$_ENV[$var] = $env;
}
}
if (isset($_ENV['PMA_QUERYHISTORYDB'])) {
$cfg['QueryHistoryDB'] = boolval($_ENV['PMA_QUERYHISTORYDB']);
}
if (isset($_ENV['PMA_QUERYHISTORYMAX'])) {
$cfg['QueryHistoryMax'] = intval($_ENV['PMA_QUERYHISTORYMAX']);
}
/* Arbitrary server connection */
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
$cfg['AllowArbitraryServer'] = true;
}
/* Play nice behind reverse proxys */
if (isset($_ENV['PMA_ABSOLUTE_URI'])) {
$cfg['PmaAbsoluteUri'] = trim($_ENV['PMA_ABSOLUTE_URI']);
}
/* Figure out hosts */
/* Fallback to default linked */
$hosts = array('db');
/* Set by environment */
if (!empty($_ENV['PMA_HOST'])) {
$hosts = array($_ENV['PMA_HOST']);
$verbose = array($_ENV['PMA_VERBOSE']);
$ports = array($_ENV['PMA_PORT']);
} elseif (!empty($_ENV['PMA_HOSTS'])) {
$hosts = array_map('trim', explode(',', $_ENV['PMA_HOSTS']));
$verbose = array_map('trim', explode(',', $_ENV['PMA_VERBOSES']));
$ports = array_map('trim', explode(',', $_ENV['PMA_PORTS']));
}
if (!empty($_ENV['PMA_SOCKET'])) {
$sockets = array($_ENV['PMA_SOCKET']);
} elseif (!empty($_ENV['PMA_SOCKETS'])) {
$sockets = explode(',', $_ENV['PMA_SOCKETS']);
}
/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
$cfg['Servers'][$i]['host'] = $hosts[$i - 1];
if (isset($verbose[$i - 1])) {
$cfg['Servers'][$i]['verbose'] = $verbose[$i - 1];
}
if (isset($ports[$i - 1])) {
$cfg['Servers'][$i]['port'] = $ports[$i - 1];
}
if (isset($_ENV['PMA_USER'])) {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = $_ENV['PMA_USER'];
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : '';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
if (isset($_ENV['PMA_PMADB'])) {
$cfg['Servers'][$i]['pmadb'] = $_ENV['PMA_PMADB'];
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
}
if (isset($_ENV['PMA_CONTROLHOST'])) {
$cfg['Servers'][$i]['controlhost'] = $_ENV['PMA_CONTROLHOST'];
}
if (isset($_ENV['PMA_CONTROLPORT'])) {
$cfg['Servers'][$i]['controlport'] = $_ENV['PMA_CONTROLPORT'];
}
if (isset($_ENV['PMA_CONTROLUSER'])) {
$cfg['Servers'][$i]['controluser'] = $_ENV['PMA_CONTROLUSER'];
}
if (isset($_ENV['PMA_CONTROLPASS'])) {
$cfg['Servers'][$i]['controlpass'] = $_ENV['PMA_CONTROLPASS'];
}
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
}
for ($i = 1; isset($sockets[$i - 1]); $i++) {
$cfg['Servers'][$i]['socket'] = $sockets[$i - 1];
$cfg['Servers'][$i]['host'] = 'localhost';
}
/*
* Revert back to last configured server to make
* it easier in config.user.inc.php
*/
$i--;
/* Uploads setup */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];
}
if (isset($_ENV['MEMORY_LIMIT'])) {
$cfg['MemoryLimit'] = $_ENV['MEMORY_LIMIT'];
}
/* Include User Defined Settings Hook */
if (file_exists('/etc/phpmyadmin/config.user.inc.php')) {
include('/etc/phpmyadmin/config.user.inc.php');
}
+50
View File
@@ -0,0 +1,50 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
EOT
fi
if [ ! -f /etc/phpmyadmin/config.user.inc.php ]; then
touch /etc/phpmyadmin/config.user.inc.php
fi
fi
if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo "PHP version is now hidden."
echo -e 'expose_php = Off\n' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi
if [ ! -z "${PMA_CONFIG_BASE64}" ]; then
echo "Adding the custom config.inc.php from base64."
echo "${PMA_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.inc.php
fi
if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "Adding the custom config.user.inc.php from base64."
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
# Check if the variable with name $env_var_file (which is $PMA_PASSWORD_FILE for example)
# is not empty and export $PMA_PASSWORD as the password in the Docker secrets file
if [[ -n "${!env_var_file}" ]]; then
export "${env_var}"="$(cat "${!env_var_file}")"
fi
}
get_docker_secret PMA_PASSWORD
get_docker_secret MYSQL_ROOT_PASSWORD
get_docker_secret MYSQL_PASSWORD
get_docker_secret PMA_HOSTS
get_docker_secret PMA_HOST
get_docker_secret PMA_CONTROLPASS
exec "$@"
+126
View File
@@ -0,0 +1,126 @@
FROM php:8.0-fpm
# Install dependencies
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libbz2-dev \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
libzip-dev \
; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
docker-php-ext-install -j "$(nproc)" \
bz2 \
gd \
mysqli \
opcache \
zip \
; \
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
ENV MAX_EXECUTION_TIME 600
ENV MEMORY_LIMIT 512M
ENV UPLOAD_LIMIT 2048K
RUN set -ex; \
\
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly=1'; \
echo 'session.use_strict_mode=1'; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen=Off'; \
echo 'max_execution_time=${MAX_EXECUTION_TIME}'; \
echo 'max_input_vars=10000'; \
echo 'memory_limit=${MEMORY_LIMIT}'; \
echo 'post_max_size=${UPLOAD_LIMIT}'; \
echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \
} > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini
# Calculate download URL
ENV VERSION 5.1.3
ENV SHA256 c562feddc0f8ff5e69629113f273a0d024a65fb928c48e89ce614744d478296f
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
gnupg \
dirmngr \
; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl -fsSL -o phpMyAdmin.tar.xz $URL; \
curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.openpgp.org --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /var/www/html --strip-components=1; \
mkdir -p /var/www/html/tmp; \
chown www-data:www-data /var/www/html/tmp; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -r -v /var/www/html/setup/ /var/www/html/examples/ /var/www/html/js/src/ /var/www/html/templates/test/ /var/www/html/babel.config.json /var/www/html/doc/html/_sources/ /var/www/html/RELEASE-DATE-$VERSION /var/www/html/CONTRIBUTING.md; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /var/www/html/libraries/vendor_config.php; \
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# Copy configuration
COPY config.inc.php /etc/phpmyadmin/config.inc.php
# Copy main script
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["php-fpm"]
+152
View File
@@ -0,0 +1,152 @@
<?php
require('/etc/phpmyadmin/config.secret.inc.php');
/* Ensure we got the environment */
$vars = array(
'PMA_ARBITRARY',
'PMA_HOST',
'PMA_HOSTS',
'PMA_VERBOSE',
'PMA_VERBOSES',
'PMA_PORT',
'PMA_PORTS',
'PMA_SOCKET',
'PMA_SOCKETS',
'PMA_USER',
'PMA_PASSWORD',
'PMA_ABSOLUTE_URI',
'PMA_CONTROLHOST',
'PMA_CONTROLPORT',
'PMA_PMADB',
'PMA_CONTROLUSER',
'PMA_CONTROLPASS',
'PMA_QUERYHISTORYDB',
'PMA_QUERYHISTORYMAX',
'MAX_EXECUTION_TIME',
'MEMORY_LIMIT'
);
foreach ($vars as $var) {
$env = getenv($var);
if (!isset($_ENV[$var]) && $env !== false) {
$_ENV[$var] = $env;
}
}
if (isset($_ENV['PMA_QUERYHISTORYDB'])) {
$cfg['QueryHistoryDB'] = boolval($_ENV['PMA_QUERYHISTORYDB']);
}
if (isset($_ENV['PMA_QUERYHISTORYMAX'])) {
$cfg['QueryHistoryMax'] = intval($_ENV['PMA_QUERYHISTORYMAX']);
}
/* Arbitrary server connection */
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
$cfg['AllowArbitraryServer'] = true;
}
/* Play nice behind reverse proxys */
if (isset($_ENV['PMA_ABSOLUTE_URI'])) {
$cfg['PmaAbsoluteUri'] = trim($_ENV['PMA_ABSOLUTE_URI']);
}
/* Figure out hosts */
/* Fallback to default linked */
$hosts = array('db');
/* Set by environment */
if (!empty($_ENV['PMA_HOST'])) {
$hosts = array($_ENV['PMA_HOST']);
$verbose = array($_ENV['PMA_VERBOSE']);
$ports = array($_ENV['PMA_PORT']);
} elseif (!empty($_ENV['PMA_HOSTS'])) {
$hosts = array_map('trim', explode(',', $_ENV['PMA_HOSTS']));
$verbose = array_map('trim', explode(',', $_ENV['PMA_VERBOSES']));
$ports = array_map('trim', explode(',', $_ENV['PMA_PORTS']));
}
if (!empty($_ENV['PMA_SOCKET'])) {
$sockets = array($_ENV['PMA_SOCKET']);
} elseif (!empty($_ENV['PMA_SOCKETS'])) {
$sockets = explode(',', $_ENV['PMA_SOCKETS']);
}
/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
$cfg['Servers'][$i]['host'] = $hosts[$i - 1];
if (isset($verbose[$i - 1])) {
$cfg['Servers'][$i]['verbose'] = $verbose[$i - 1];
}
if (isset($ports[$i - 1])) {
$cfg['Servers'][$i]['port'] = $ports[$i - 1];
}
if (isset($_ENV['PMA_USER'])) {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = $_ENV['PMA_USER'];
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : '';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
if (isset($_ENV['PMA_PMADB'])) {
$cfg['Servers'][$i]['pmadb'] = $_ENV['PMA_PMADB'];
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
}
if (isset($_ENV['PMA_CONTROLHOST'])) {
$cfg['Servers'][$i]['controlhost'] = $_ENV['PMA_CONTROLHOST'];
}
if (isset($_ENV['PMA_CONTROLPORT'])) {
$cfg['Servers'][$i]['controlport'] = $_ENV['PMA_CONTROLPORT'];
}
if (isset($_ENV['PMA_CONTROLUSER'])) {
$cfg['Servers'][$i]['controluser'] = $_ENV['PMA_CONTROLUSER'];
}
if (isset($_ENV['PMA_CONTROLPASS'])) {
$cfg['Servers'][$i]['controlpass'] = $_ENV['PMA_CONTROLPASS'];
}
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
}
for ($i = 1; isset($sockets[$i - 1]); $i++) {
$cfg['Servers'][$i]['socket'] = $sockets[$i - 1];
$cfg['Servers'][$i]['host'] = 'localhost';
}
/*
* Revert back to last configured server to make
* it easier in config.user.inc.php
*/
$i--;
/* Uploads setup */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];
}
if (isset($_ENV['MEMORY_LIMIT'])) {
$cfg['MemoryLimit'] = $_ENV['MEMORY_LIMIT'];
}
/* Include User Defined Settings Hook */
if (file_exists('/etc/phpmyadmin/config.user.inc.php')) {
include('/etc/phpmyadmin/config.user.inc.php');
}
+50
View File
@@ -0,0 +1,50 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
EOT
fi
if [ ! -f /etc/phpmyadmin/config.user.inc.php ]; then
touch /etc/phpmyadmin/config.user.inc.php
fi
fi
if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo "PHP version is now hidden."
echo -e 'expose_php = Off\n' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi
if [ ! -z "${PMA_CONFIG_BASE64}" ]; then
echo "Adding the custom config.inc.php from base64."
echo "${PMA_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.inc.php
fi
if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "Adding the custom config.user.inc.php from base64."
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
# Check if the variable with name $env_var_file (which is $PMA_PASSWORD_FILE for example)
# is not empty and export $PMA_PASSWORD as the password in the Docker secrets file
if [[ -n "${!env_var_file}" ]]; then
export "${env_var}"="$(cat "${!env_var_file}")"
fi
}
get_docker_secret PMA_PASSWORD
get_docker_secret MYSQL_ROOT_PASSWORD
get_docker_secret MYSQL_PASSWORD
get_docker_secret PMA_HOSTS
get_docker_secret PMA_HOST
get_docker_secret PMA_CONTROLPASS
exec "$@"
+96
View File
@@ -0,0 +1,96 @@
#!/bin/bash
set -e
self="$(basename "$BASH_SOURCE")"
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
# Get the most recent commit which modified any of "$@".
fileCommit() {
git log -1 --format='format:%H' HEAD -- "$@"
}
# Get the most recent commit which modified "$1/Dockerfile" or any file that
# the Dockerfile copies into the rootfs (with COPY).
dockerfileCommit() {
local dir="$1"; shift
(
cd "$dir";
fileCommit Dockerfile \
$(git show HEAD:./Dockerfile | awk '
toupper($1) == "COPY" {
for (i = 2; i < NF; i++)
print $i;
}
')
)
}
getArches() {
local repo="$1"; shift
local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/'
eval "declare -g -A parentRepoToArches=( $(
find -name 'Dockerfile' -exec awk '
toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ {
print "'"$officialImagesUrl"'" $2
}
' '{}' + \
| sort -u \
| xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"'
) )"
}
if ! command -v bashbrew --version &> /dev/null
then
echo "bashbrew could not be found"
echo "You can download it from Jenkins at https://github.com/docker-library/bashbrew#installing"
exit 1
fi
getArches 'phpmyadmin'
# Header.
cat <<-EOH
# This file is generated via https://github.com/phpmyadmin/docker/blob/$(fileCommit "$self")/$self
Maintainers: Isaac Bennetch <bennetch@gmail.com> (@ibennetch),
William Desportes <williamdes@wdes.fr> (@williamdes)
GitRepo: https://github.com/phpmyadmin/docker.git
EOH
# prints "$2$1$3$1...$N"
join() {
local sep="$1"; shift
local out; printf -v out "${sep//%/%%}%s" "$@"
echo "${out#$sep}"
}
latest="$(curl -fsSL 'https://www.phpmyadmin.net/home_page/version.json' | jq -r '.version')"
for variant in apache fpm fpm-alpine; do
commit="$(dockerfileCommit "$variant")"
fullversion="$(git show "$commit":"$variant/Dockerfile" | awk '$1 == "ENV" && $2 == "VERSION" { print $3; exit }')"
versionAliases=( "$fullversion" "${fullversion%.*}" "${fullversion%.*.*}" )
if [ "$fullversion" = "$latest" ]; then
versionAliases+=( "latest" )
fi
variantAliases=( "${versionAliases[@]/%/-$variant}" )
variantAliases=( "${variantAliases[@]//latest-}" )
if [ "$variant" = "apache" ]; then
variantAliases+=( "${versionAliases[@]}" )
fi
variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$variant/Dockerfile")"
variantArches="${parentRepoToArches[$variantParent]}"
cat <<-EOE
Tags: $(join ', ' "${variantAliases[@]}")
Architectures: $(join ', ' $variantArches)
GitCommit: $commit
Directory: $variant
EOE
done
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
# This file is used by docker hub to build the image
docker build -t $IMAGE_NAME .
Binary file not shown.
-22
View File
@@ -1,22 +0,0 @@
#!/bin/sh
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ] ; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
EOT
fi
if [ ! -f /etc/phpmyadmin/config.user.inc.php ] ; then
touch /etc/phpmyadmin/config.user.inc.php
fi
mkdir -p /var/nginx/client_body_temp
chown nobody:nobody /sessions /var/nginx/client_body_temp
mkdir -p /var/run/php/
chown nobody:nobody /var/run/php/
touch /var/log/php-fpm.log
chown nobody:nobody /var/log/php-fpm.log
if [ "$1" = 'phpmyadmin' ]; then
exec supervisord --nodaemon --configuration="/etc/supervisord.conf" --loglevel=info
fi
+5 -6
View File
@@ -1,10 +1,9 @@
# Testing image for phpMyAdmin
FROM phpmyadmin/phpmyadmin
FROM alpine:3.12
# Install test dependencies
RUN apk add --no-cache curl py2-pip
RUN pip install mechanize html5lib
COPY test-mariadb.ini test-mysql.ini /etc/supervisor.d/
COPY phpmyadmin_test.py test-docker.sh world.sql /
RUN set -ex; \
\
apk add --no-cache --update mariadb-client bash \
py3-html5lib py3-pytest py3-mechanize
+3
View File
@@ -0,0 +1,3 @@
<?php
$cfg['ShowPhpInfo'] = true;
+28
View File
@@ -0,0 +1,28 @@
import pytest
def pytest_addoption(parser):
parser.addoption("--url")
parser.addoption("--username")
parser.addoption("--password")
parser.addoption("--server")
parser.addoption("--sqlfile")
@pytest.fixture
def url(request):
return request.config.getoption("--url")
@pytest.fixture
def username(request):
return request.config.getoption("--username")
@pytest.fixture
def password(request):
return request.config.getoption("--password")
@pytest.fixture
def server(request):
return request.config.getoption("--server")
@pytest.fixture
def sqlfile(request):
return request.config.getoption("--sqlfile")
+71 -35
View File
@@ -1,29 +1,22 @@
#!/usr/bin/env python
#!/usr/bin/env python2
import argparse
import os
import subprocess
import re
import sys
import mechanize
import tempfile
import pytest
def test_content(match, content):
if not match in content:
print(content)
raise Exception('{0} not found in content!'.format(match))
def test_phpmyadmin(url, username, password, server=None, sqlfile=None):
if sqlfile is None:
if os.path.exists('./world.sql'):
sqlfile = './world.sql'
else:
sqlfile = './testing/world.sql'
def create_browser():
br = mechanize.Browser()
# Ignore robots.txt
br.set_handle_robots(False)
return br
def do_login(br, url, username, password, server):
# Login page
br.open(url)
@@ -34,38 +27,81 @@ def test_phpmyadmin(url, username, password, server=None, sqlfile=None):
if server is not None:
br['pma_servername'] = server
# Login and check if loggged in
# Login and check if logged in
response = br.submit()
test_content('Server version', response.read())
return response
def test_phpmyadmin(url, username, password, server, sqlfile):
if sqlfile is None:
if os.path.exists('/world.sql'):
sqlfile = '/world.sql'
elif os.path.exists('./world.sql'):
sqlfile = './world.sql'
else:
path = os.path.dirname(os.path.realpath(__file__))
sqlfile = path + '/world.sql'
br = create_browser()
response = do_login(br, url, username, password, server)
assert(b'Server version' in response.read())
# Open server import
response = br.follow_link(text_regex=re.compile('Import'))
test_content('OpenDocument Spreadsheet', response.read())
assert(b'OpenDocument Spreadsheet' in response.read())
# Upload SQL file
br.select_form('import')
br.form.add_file(open(sqlfile), 'text/plain', sqlfile)
response = br.submit()
test_content('5326 queries executed', response.read())
assert(b'5326 queries executed' in response.read())
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--url', required=True)
parser.add_argument('--username', required=True)
parser.add_argument('--password', required=True)
parser.add_argument('--server')
parser.add_argument('--sqlfile', default=None)
args = parser.parse_args()
def docker_secret(env_name):
dir_path = os.path.dirname(os.path.realpath(__file__))
secret_file = tempfile.mkstemp()
test_phpmyadmin(
args.url,
args.username,
args.password,
args.server,
args.sqlfile
)
password = "The_super_secret_password"
password_file = open(secret_file[1], 'wb')
password_file.write(str.encode(password))
password_file.close()
test_env = {env_name + '_FILE': secret_file[1]}
# Run entrypoint and afterwards echo the environment variables
result = subprocess.Popen("bash " +dir_path+ "/../docker-entrypoint.sh 'env'", shell=True, stdout=subprocess.PIPE, env=test_env)
output = result.stdout.read().decode()
assert (env_name + "=" + password) in output
def test_phpmyadmin_secrets():
docker_secret('MYSQL_PASSWORD')
docker_secret('MYSQL_ROOT_PASSWORD')
docker_secret('PMA_PASSWORD')
docker_secret('PMA_HOSTS')
docker_secret('PMA_HOST')
docker_secret('PMA_CONTROLPASS')
if __name__ == '__main__':
main()
def test_php_ini(url, username, password, server):
br = create_browser()
response = do_login(br, url, username, password, server)
assert(b'Show PHP information' in response.read())
# Open Show PHP information
response = br.follow_link(text_regex=re.compile('Show PHP information'))
response = response.read()
assert(b'PHP Version' in response)
assert(b'upload_max_filesize' in response)
assert(b'post_max_size' in response)
assert(b'expose_php' in response)
assert(b'<tr><td class="e">max_execution_time</td><td class="v">125</td><td class="v">125</td></tr>' in response)
assert(b'<tr><td class="e">upload_max_filesize</td><td class="v">123M</td><td class="v">123M</td></tr>' in response)
assert(b'<tr><td class="e">post_max_size</td><td class="v">123M</td><td class="v">123M</td></tr>' in response)
assert(b'<tr><td class="e">expose_php</td><td class="v">Off</td><td class="v">Off</td></tr>' in response)
+28 -77
View File
@@ -1,92 +1,43 @@
#!/bin/sh
NAME="$1"
if [ -n "$2" ] ; then
PORT="$2"
TESTSUITE_PORT=$2
fi
if [ -n "$3" ] ; then
SERVER="--server $3"
PMA_HOST=$3
else
SERVER=''
fi
# Set PHPMyAdmin environment
# Set phpMyAdmin environment
PHPMYADMIN_HOSTNAME=${TESTSUITE_HOSTNAME:=localhost}
PHPMYADMIN_PORT=${TESTSUITE_PORT:=80}
PHPMYADMIN_URL=http://$PHPMYADMIN_HOSTNAME:$PORT/
PHPMYADMIN_URL=http://${PHPMYADMIN_HOSTNAME}:${PHPMYADMIN_PORT}/
# Color text output
GREEN="\033[0;32m"
RED="\033[0;31m"
NC="\033[0m" # No Color
# Set database environment
PHPMYADMIN_DB_HOSTNAME=${PMA_HOST:=localhost}
PHPMYADMIN_DB_PORT=${PMA_PORT:=3306}
ret=0
# Check if script is running inside container
if [ -f /.dockerenv ] ; then
echo "Tests running inside container..."
if [ ! -z "${TESTSUITE_HOSTNAME_ARBITRARY}" ]; then
SERVER="--server ${PHPMYADMIN_DB_HOSTNAME}"
fi
# Set database environment
PHPMYADMIN_DB_HOSTNAME=${PMA_HOST:=localhost}
PHPMYADMIN_DB_PORT=${PMA_PORT:=3306}
PHPMYADMIN_DB_URL=http://$PHPMYADMIN_DB_HOSTNAME:$PHPMYADMIN_DB_PORT/
# Wait for database to start
TIMEOUT=0
while ! curl "$PHPMYADMIN_DB_URL" &>/dev/null; do
echo "Waiting for ${PHPMYADMIN_DB_HOSTNAME} database start..."
sleep 10
TIMEOUT=$((TIMEOUT + 1))
if [ $TIMEOUT -gt 3 ] ; then
echo "Failed to connect ${PHPMYADMIN_DB_HOSTNAME} database!"
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: ${RED}FAILED${NC}"
ret=1
exit 1
fi
done
# Find test script
if [ -f ./phpmyadmin_test.py ] ; then
FILENAME=./phpmyadmin_test.py
else
echo "Tests running outside container..."
docker ps -a
COMMAND_HOST="docker exec ${NAME}"
FILENAME=./testing/phpmyadmin_test.py
fi
# Wait for container to start
TIMEOUT=0
while ! $COMMAND_HOST ps aux | grep -q nginx ; do
echo "Waiting for PHPMyAdmin start..."
sleep 1
TIMEOUT=$((TIMEOUT + 1))
if [ $TIMEOUT -gt 10 ] ; then
echo "Failed to connect PHPMyAdmin!"
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: ${RED}FAILED${NC}"
ret=1
exit 1
fi
done
mysql -h "${PHPMYADMIN_DB_HOSTNAME}" -P"${PHPMYADMIN_DB_PORT}" -u"${TESTSUITE_USER:=root}" -p"${TESTSUITE_PASSWORD}" -e "SELECT @@version;" > /dev/null
ret=$?
# Perform tests
if [ $ret -eq 0 ] ; then
if [ -f ./phpmyadmin_test.py ] ; then
FILENAME=./phpmyadmin_test.py
else
FILENAME=./testing/phpmyadmin_test.py
fi
python $FILENAME --url "$PHPMYADMIN_URL" --username root --password $TESTSUITE_PASSWORD $SERVER
ret=$?
fi
# Show debug output in case of failure
if [ $ret -ne 0 ] ; then
curl "$PHPMYADMIN_URL"
$COMMAND_HOST ps faux
$COMMAND_HOST cat /var/log/php-fpm.log
$COMMAND_HOST cat /var/log/nginx-error.log
$COMMAND_HOST cat /var/log/supervisord.log
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: ${RED}FAILED${NC}"
echo "Could not connect to ${PHPMYADMIN_DB_HOSTNAME} on port ${PHPMYADMIN_DB_PORT}"
exit $ret
fi
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: ${GREEN}SUCCESS${NC}"
# Perform tests
ret=0
pytest -p no:cacheprovider -q --url "$PHPMYADMIN_URL" --username ${TESTSUITE_USER:=root} --password "$TESTSUITE_PASSWORD" $SERVER $FILENAME
ret=$?
# Show debug output in case of failure
if [ $ret -ne 0 ] ; then
${COMMAND_HOST} ps faux
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: FAILED"
exit $ret
fi
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: SUCCESS"
-11
View File
@@ -1,11 +0,0 @@
[program:test-mariadb]
command=/test-docker.sh test 80 mariadb
autostart=true
autorestart=false
priority=3
startretries=1
stopwaitsecs=20
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
-11
View File
@@ -1,11 +0,0 @@
[program:test-mysql]
command=/test-docker.sh test 80 mysql
autostart=true
autorestart=false
priority=3
startretries=1
stopwaitsecs=20
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
+2
View File
@@ -0,0 +1,2 @@
[mysqld]
default_authentication_plugin = mysql_native_password
-32
View File
@@ -1,32 +0,0 @@
#!/bin/sh
# Helper script to wait for testing inside container completes
# Needs running docker-compose container based on docker-compose.testing.yml
GREEN="\033[0;32m"
RED="\033[0;31m"
NC="\033[0m" # No Color
TIMEOUT=0
sleep 5
while [ `docker-compose -f docker-compose.testing.yml logs phpmyadmin | grep -c 'Result of \(mysql\|mariadb\) tests'` -lt 2 ] ; do
sleep 1
TIMEOUT=$(($TIMEOUT + 1))
if [ $TIMEOUT -gt 20 ] ; then
docker-compose -f docker-compose.testing.yml logs phpmyadmin
echo "${RED}Timeout!${NC}"
exit 1
fi
done
if [ `docker-compose -f docker-compose.testing.yml logs phpmyadmin | grep -c 'Result of \(mysql\|mariadb\) tests.*SUCCESS'` -lt 2 ] ; then
docker-compose -f docker-compose.testing.yml logs phpmyadmin
echo "${RED}Failed${NC}"
exit 2
fi
docker-compose -f docker-compose.testing.yml logs phpmyadmin
echo "${GREEN}Success${NC}"
exit 0
Executable
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
set -e
# Check for dependencies
command -v curl >/dev/null 2>&1 || { echo >&2 "'curl' is required but not found. Aborting."; exit 1; }
command -v jq >/dev/null 2>&1 || { echo >&2 "'jq' is required but not found. Aborting."; exit 1; }
if [ -z "${BASH_VERSINFO}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ ${BASH_VERSINFO[0]} -lt 4 ]; then
echo "BASH version 4.0 or greater is required. Aborting."
exit 1
fi
declare -A cmd=(
[apache]='apache2-foreground'
[fpm]='php-fpm'
[fpm-alpine]='php-fpm'
)
declare -A base=(
[apache]='debian'
[fpm]='debian'
[fpm-alpine]='alpine'
)
latest="$(curl -fsSL 'https://www.phpmyadmin.net/home_page/version.json' | jq -r '.version')"
sha256="$(curl -fsSL "https://files.phpmyadmin.net/phpMyAdmin/$latest/phpMyAdmin-$latest-all-languages.tar.xz.sha256" | cut -f1 -d ' ' | tr -cd 'a-f0-9' | cut -c 1-64)"
for variant in apache fpm fpm-alpine; do
template="Dockerfile-${base[$variant]}.template"
cp $template "$variant/Dockerfile"
cp config.inc.php "$variant/config.inc.php"
cp docker-entrypoint.sh "$variant/docker-entrypoint.sh"
sed -ri -e '
s/%%VERSION%%/'"$latest"'/;
s/%%SHA256%%/'"$sha256"'/;
s/%%VARIANT%%/'"$variant"'/;
s/%%CMD%%/'"${cmd[$variant]}"'/;
' "$variant/Dockerfile"
done