Compare commits

..
296 Commits
Author SHA1 Message Date
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
Isaac Bennetch 686bf94364 Update to 4.7.6
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-11-30 22:37:35 -05:00
Michal ČihařandGitHub ade6f52350 Merge pull request #140 from kujiy/master
Added description of `PMA_PORTS`
2017-11-20 09:42:24 +01:00
KujiyandGitHub c29aadee1b Added description of PMA_PORTS 2017-11-20 14:30:46 +09:00
Isaac Bennetch 30857caf5c Update for phpMyAdmin 4.7.5
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-10-23 09:33:39 -04:00
Michal Čihař 2c92dfa55c Add configuration for Probot Stale
See https://github.com/probot/stale/

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-09-05 13:56:56 +02:00
Michal Čihař a576282372 Update to Alpine linux 3.6
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-09-05 13:55:59 +02:00
Isaac Bennetch c4abbbaa35 Update to 4.7.4
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-08-24 19:30:29 -04:00
Michal Čihař 15e82b23d2 Update to 4.7.3
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-07-20 23:09:24 +02:00
Isaac Bennetch ff2edd1f87 Update Docker image to phpMyAdmin 4.7.2
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-06-29 15:35:37 -04:00
Michal Čihař 275b59e3dd Remove no longer needed ctype dependency
Fixes #115

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-06-19 12:42:05 +02:00
Michal ČihařandGitHub a18b6e3842 Merge pull request #128 from tomasliubinas/patch-1
Remove link to db container
2017-06-07 15:25:14 +02:00
Tomas LiubinasandGitHub 524e669ce9 Remove link to another container
You don't need linking to db container in case of arbitrary server
2017-06-07 16:09:49 +03:00
Isaac Bennetch 8884f19c18 Update Docker image to 4.7.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-05-26 12:36:15 -04:00
Michal Čihař 1cfae7dbf6 Document new docker tags
We will build images based on snapshots as well.

Fixes #109

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-05-05 16:18:49 +02:00
Michal ČihařandGitHub 24fd978c91 Run Travis tests on Trusty (#123)
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-05-05 14:15:52 +02:00
Michal Čihař 77d49d4d88 Create directory for sessions
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-28 13:20:04 +02:00
Michal Čihař 76631a48de Remove VOLUME from Dockerfile
Fixes #117

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-28 12:06:14 +02:00
Michal Čihař 6f28900cf9 Increase fastcgi_read_timeout
Fixes #120

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-28 11:54:58 +02:00
Michal Čihař 3febe28134 Document 4.7 tag
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-11 17:33:56 +02:00
Michal Čihař 1bcaeb5fec Fix getting empty values from environment
If environemnt variable is empty and is not part of $_ENV, the getenv
(obviously) returns empty string, but we should use it.

Fixes #118

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-11 17:28:29 +02:00
Michal Čihař 1204bcd696 Do not set password to null when not specified
This makes the authentication code think this parameter was not set at
all.

Fixes #118

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-11 17:21:32 +02:00
ericfjosneandMichal Čihař 447c731aaa Add PMA_PORTS configuration
Now enabling custom port for each hosts of the PMA_HOSTS environment variable, through the use of a new PMA_PORTS environment variable.

Fixes #112
2017-04-07 15:24:36 +02:00
Michal Čihař 69a0e832d9 Install php7-ctype into the container
It is needed by Symfony ExpressionLanguage (which is used by
motranslator for plurals).

This can be reverted once ExpressionLanguage is fixed
https://github.com/symfony/symfony/pull/22325

Fixes #115

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-07 07:53:31 +02:00
Michal Čihař 0fb67d3437 Adjust cleanup to current releases
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-05 20:39:40 +02:00
Michal Čihař 331c3452f4 These files are no longer part of release
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-05 20:37:56 +02:00
Michal Čihař 942a0dd5ff Update to 4.7.0
Fixes #113

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-05 20:10:35 +02:00
Michal Čihař c76721ba8b Fix typo
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:18:16 +02:00
Michal Čihař 554e98df45 Add dabase server link to docker-compose
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:14:02 +02:00
Michal Čihař 5646cff98e Do not report retries
This is expected to take some time...

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:09:20 +02:00
Michal Čihař 382f9b9489 better progress reporting
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:07:27 +02:00
Michal Čihař 70b6297233 Fix path to testing configuration
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:02:09 +02:00
Michal Čihař 6314b17ebd Need more time to run tests
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:01:34 +02:00
Michal Čihař 63fd59434e Display logs on timeout
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 14:51:04 +02:00
Michal Čihař a2782dd8f6 Detect correct path to sql file
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 14:50:01 +02:00
Michal Čihař 61bc237761 Document this is supposed to fail right now
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 14:30:32 +02:00
Michal Čihař 6736b49f7a Fix expression calculation
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 14:27:00 +02:00
Michal Čihař b5305971ba Verify test result from docker-compose.testing.yml
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:38:35 +02:00
Michal Čihař 2ebc458766 Run pip installation while building Docker container
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:30:44 +02:00
Michal Čihař 21b0804166 Use latest images for composer testing as well
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:30:21 +02:00
Michal Čihař b35554203c Fix path to testing script
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:27:10 +02:00
Michal Čihař e5a78047b2 Move all testing files into subdirectory
This makes the file structure a bit cleaner.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:24:10 +02:00
Michal Čihař a7aa88b4c6 Specify correct server to test
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:18:09 +02:00
Michal Čihař b45585ea00 Remove trailing whitespace
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:12:31 +02:00
Michal Čihař 5d3536c381 Ignore testing dockerfile from docker
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:12:11 +02:00
Michal Čihař 24679b0c0b Run docker-compose tests in Travis
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:11:04 +02:00
Michal Čihař f5c3a1b628 Avoid using echo -e
It is not working on some /bin/sh versions and there is no reason to
enforce bash just because of this.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:08:37 +02:00
Michal Čihař d79872987d Avoid setting set -e
We are handling error codes, so we do not want script to terminate automatically

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:08:10 +02:00
Paulo LobatoandMichal Čihař ed5d9c5fc9 Provision local test env similar the CI's tests
- Run tests inside or not container
2017-03-28 11:06:54 +02:00
Michal Čihař 446ed9e0d0 Use separate Dockerfile for testing image
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:05:23 +02:00
Paulo LobatoandMichal Čihař 4ddc41bc29 Document the docker-compose test environment 2017-03-28 11:04:12 +02:00
Paulo LobatoandMichal Čihař ec28d93349 Add database containers on compose test env
- Add MariaDB 10.1 version
  - Add MySQL 5.7 version
  - Link databases to PHPMyAdmin container
2017-03-28 11:03:46 +02:00
Michal Čihař 0ac5c9516c Fix syntax errors
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:31:55 +01:00
Michal Čihař a1270dc0d5 Avoid using non ascii chars
This just makes the testing harder

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:26:18 +01:00
Michal Čihař 73ea59e04b Impove coding style
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:25:56 +01:00
Michal Čihař 54a5953b37 Mechanize does not support Python 3
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:11:01 +01:00
Michal Čihař d07907e15d Use python 3 for testing
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:08:40 +01:00
Michal Čihař e2f38b46ab Install html5lib needed for mechanize
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:02:12 +01:00
Michal Čihař cbcd23494f Generate password before using it
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 10:59:03 +01:00
Michal Čihař 4432177a0a Generate random passwords for test
This way nobody will think there is anything secret in the
.travis.yml.

See https://github.com/phpmyadmin/phpmyadmin/issues/13115

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 10:34:03 +01:00
Michal Čihař e2052a2066 Enable opcache fast shutdown
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-02 09:54:30 +01:00
Michal Čihař 6e3955516f Disable opcache.use_cwd
All scripts are executed in single working directory, so it should not
cause any harm and according to documentation it should perform better.

Issue #98

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-02 09:45:40 +01:00
Michal Čihař 29d69f34ad Disable opcache API
By setting non existing path as restrict_api.

Fixes #65

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-02 09:44:13 +01:00
Michal Čihař ddfe8e2b1c Update php.ini
Update to match php.ini-production from PHP 7.0.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-02 09:40:43 +01:00
Michal Čihař facd453fc2 Disable allow_url_fopen
Fixes #55

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-02 09:27:46 +01:00
Michal Čihař b4d05f2604 Update to 4.6
Fixes #105

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-06 11:24:11 +01:00
Michal ČihařandGitHub ff50a29234 Merge pull request #102 from nijel/alpine-3.5
Upgrade to Alpine 3.5
2017-01-02 17:14:57 +01:00
Michal Čihař e943ff30d0 Merge remote-tracking branch 'origin/pull/94' into alpine-3.5 2017-01-02 17:00:46 +01:00
Michal Čihař 19a74cb25f Fix program name
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-01-02 16:56:07 +01:00
Michal Čihař a9cce1d72c Upgrade to Alpine 3.5
Also switch to PHP 7

Fixes #34

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-22 19:41:50 +01:00
Michal Čihař 4bc799bdb4 Fix markup
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-06 11:20:27 +01:00
Michal Čihař cc3e874181 Document hub tags
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-06 11:19:29 +01:00
Michal Čihař ba761c1841 Update to 4.6.5.2
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-06 09:03:57 +01:00
Michal Čihař d67fafa56c Remove not needed dependency on ctype
Fixes #96

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-05 08:41:19 +01:00
Michal Čihař bca3574cf3 Use absolute path here
Issue #95

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-30 11:34:21 +01:00
Michal Čihař c5c62ee24b Create secret and user configs in /etc/phpmyadmin
Fixes #95

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-30 11:17:43 +01:00
Michal Čihař 78f2603e29 Remove more not needed doc files
Fixes #79

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-30 11:16:40 +01:00
Michal Čihař 0715366ee3 Add version label
Issue #85

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-28 16:39:38 +01:00
Sam Mousa a4dc5b36cd Added some missing php extensions. 2016-11-28 10:48:41 +01:00
Sam Mousa f626ed635b Updated to use alpine edge and php7. 2016-11-28 10:40:43 +01:00
Michal Čihař 2a761b2a73 Increase upload size limit to 512MB
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-28 10:39:25 +01:00
Michal ČihařandGitHub f544b5ca97 Merge pull request #92 from nijel/master
Try to reorder commands for better Docker layer caching
2016-11-28 10:23:19 +01:00
Michal ČihařandGitHub d53aadc0bb Merge pull request #93 from nijel/doc-cleanup
Cleanup documentation folder
2016-11-28 10:23:12 +01:00
Michal Čihař f581555bcf Move all configuration to /etc
* configuration is now in /etc
* reorder commands for better Docker layer caching

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-28 10:19:52 +01:00
Michal Čihař 5cef68749a Cleanup documentation folder
We really do not need documentation source in the Docker image.

Fixes #79

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-28 10:12:56 +01:00
Michal ČihařandGitHub 6c1410cbef Merge pull request #91 from nijel/master
Split setting variable from export
2016-11-28 09:37:14 +01:00
Michal Čihař 352e5fe6ed Split setting variable from export
This way we can correctly get error from the mkdir.

Fixes #86

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-28 09:31:58 +01:00
Michal ČihařandGitHub c81443abd1 Merge pull request #90 from vancepym/patch-1
Bump version to 4.6.5.1
2016-11-28 09:29:51 +01:00
vancepymandGitHub 7177389b20 Bump version to 4.6.5.1 2016-11-28 13:35:17 +08:00
Michal ČihařandGitHub 3142368a07 Merge pull request #89 from asolopovas/patch-1
Cancel removal of /www/sql
2016-11-25 15:23:28 +01:00
Andrius SolopovasandGitHub a017968642 Cancel removal of /www/sql
Please do not delete /www/sql folder as it contains create_tables.sql file that creates pma tables and phpmyadmin db for configuration storage
2016-11-24 21:45:58 +00:00
Michal Čihař 9b115208c7 Simplify password generating
- remove not needed cat, this makes it consume less entropy due to less
  buffering
- use $() instead of `` in shell

Fixes #78

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-21 16:09:28 +01:00
Michal Čihař 2e371a1cb5 Simplify expression evaluation
Issue #87

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-21 16:07:48 +01:00
Michal Čihař af486daba0 Add quotes around parameters
Issue #87

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-21 16:07:45 +01:00
Michal Čihař a53f732a77 Use URL variable instead of hardcoding it
Issue #87

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-21 16:07:42 +01:00
Michal Čihař 50f822a1c9 Remove more not needed files
Fixes #78

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-25 10:45:00 +02:00
Michal Čihař 101ce17f0d Document where to report issues
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 13:14:37 +02:00
Michal ČihařandGitHub f9c263baf2 Merge pull request #77 from nijel/nginx-setup
Improve nginx setup
2016-10-18 13:07:18 +02:00
Michal ČihařandGitHub 71bf1edde3 Merge pull request #74 from nijel/userconfig
Fix user configuration and add tests for it
2016-10-18 13:03:57 +02:00
Michal Čihař 29bcc43956 Allow only GET, HEAD and POST methods
Fixes #64

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 13:03:27 +02:00
Michal Čihař 379a7df699 Avoid extending try_files too much
Fixes #63

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 13:03:27 +02:00
Michal Čihař ab9d56ffc1 Deny access to all hidden files
Fixes #67

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 13:03:27 +02:00
Michal ČihařandGitHub e3abc1a5bd Merge pull request #76 from nijel/php-name
Avoid encoding PHP version in socket or log name
2016-10-18 12:58:12 +02:00
Michal ČihařandGitHub 1807d08963 Merge pull request #75 from nijel/opcache
Optimize PHP opcache settings
2016-10-18 12:56:39 +02:00
Michal Čihař a4ddcb67ce Add tests for user configuration override
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 12:55:53 +02:00
Michal Čihař b2c5075876 Avoid encoding PHP version in socket or log name
Fixes #68

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 12:39:18 +02:00
Michal Čihař 9ddd36cd25 Optimize PHP opcache settings
- opcache.save_comments=0 to avoid storing comments which we do not need
- opcache.validate_timestamps=0 the timestamps validation should not be
  needed as container is restarted on change
- fixes #71

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 12:33:58 +02:00
Michal Čihař 6ab1e50550 Limit waiting for container to come up
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 12:26:41 +02:00
Michal Čihař cd02b8d305 Move config.user.inc.php to /www
It needs to be stored in a location allowed by open_basedir.

Fixes #73

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 12:09:58 +02:00
Michal ČihařandGitHub 465ecb08b3 Merge pull request #72 from asosso/master
Adding PMA_VERBOSE and PMA_VERBOSES environment variables
2016-10-04 16:19:38 +02:00
Andrea Sosso 07afa363d7 Adding PMA_VERBOSE and PMA_VERBOSES environment variables 2016-10-04 15:25:13 +02:00
Michal Čihař 8a3544a20a Reduce supervisor loglevel
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-27 09:18:08 +02:00
Michal Čihař 0a9d050db1 Allow access to /tmp
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 10:01:33 +02:00
Michal Čihař edce528acc Can not use armored PGP for keyring
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:25:18 +02:00
Michal Čihař 7b9abff0ff Deny access to libraries and templates
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:18:00 +02:00
Michal Čihař ad4b811c44 Set loglevel for PHP-FPM
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:15:27 +02:00
Michal Čihař 0fd626c1f6 Enable open_basedir in PHP
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:15:15 +02:00
Michal Čihař e415b21140 Make listen mode more secure
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:03:12 +02:00
Michal Čihař d935ec82f8 Include only Isaac's key for verification
There is no need to have all the keys here.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:01:51 +02:00
Michal Čihař fc12c997ef Allow to specify verbose names
Fixes #54

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 09:55:02 +02:00
Michal Čihař 55a4594325 Fix path name
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 09:40:13 +02:00
Michal Čihař 90551173a8 Use https links
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 09:08:01 +02:00
Michal Čihař b3eb5ffd23 Use SHA-1 for session hash
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 08:50:17 +02:00
Michal Čihař 3554ecfe19 Do not expose nginx version
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 08:49:34 +02:00
Michal Čihař 000827ba7a Move version we have requested
This makes the code easier to understand and avoids possible MITM on
download to push older version.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 08:45:21 +02:00
Michal Čihař 0ba8cd2bc8 Add missing find -exec separator
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 13:20:44 +02:00
Michal Čihař f7319feabf Fix line breaks
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 13:14:06 +02:00
Michal Čihař ab8caa4dd7 Adjust permissions of /www
Issue #52

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 13:01:26 +02:00
Michal Čihař 8c13128da9 Correctly prepare log for FPM
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 12:07:58 +02:00
Michal Čihař df1677c26e Display supervisor log on error
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 12:01:08 +02:00
Michal Čihař dc56655368 Move PHP socket
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 11:56:05 +02:00
Michal Čihař 8496f8fd25 Start PHP-FPM as nobody
Issue #52

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 11:47:42 +02:00
Michal Čihař e2a6eb627e List processes at the end of test
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 11:41:33 +02:00
Michal Čihař 233e07cd7b Be less strict on version
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-16 13:10:31 +02:00
Michal Čihař bae2c00e12 State which Alpine version to use
The package names could change (as did in past with php) so let's
specify exact version.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-16 12:32:33 +02:00
Michal Čihař 8fd34e6581 Add docker layers badge
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-01 12:46:56 +02:00
Michal Čihař 63557d61e9 Revert "Remove not used files from packages"
This reverts commit 38e99339ce.

It seams to break startup and does not really save anything reasonable.
2016-08-29 11:52:36 +02:00
Michal Čihař bac44a4dbb Ignore test files for docker
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:58:20 +02:00
Michal Čihař f5fb1e42f9 Increase upload_max_filesize to be in sync with other settings
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:54:30 +02:00
Michal Čihař 38e99339ce Remove not used files from packages
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:51:35 +02:00
Michal Čihař 961aa4ce9a Remove not needed cleanup
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:45:28 +02:00
Michal Čihař fa5c90cae4 Remove php cli, we do not need it
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:40:07 +02:00
Michal Čihař 923f581fa9 Remove openlayers source from the image as well
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:35:52 +02:00
Michal Čihař 9a78cb3d33 Better cleanup of produced image
- remove setup script
- remove tests
- remove SQL scripts

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:32:39 +02:00
Michal Čihař 23b9a14189 Remove no longer used variables
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:16:02 +02:00
Michal Čihař 341bc4965d Simplify tests
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:52:49 +02:00
Michal Čihař d6060e96b5 More verbose reporting in case of error
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:41:40 +02:00
Michal Čihař 454dfd47ed Select import form by name
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:35:35 +02:00
Michal Čihař 47eaf4cb6d Add test for arbitrary server on docker-compose
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:33:33 +02:00
Michal Čihař b80eea10a2 Do not try to use arbitrary server when not enabled
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:32:52 +02:00
Michal Čihař f6ae557f95 Igore robots.txt while testing
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:29:45 +02:00
Michal Čihař d5895311c0 Fix params, correctly handle error
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:23:08 +02:00
Michal Čihař 1c0936f359 Improve server testing
- Use python-mechanize based script
- Test file upload as well

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:17:35 +02:00
Michal Čihař cc72b8a432 Really test that arbitrary server settings works
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:18:03 +02:00
Michal Čihař 5acaf20477 Whitespace cleanup in nginx configuration
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:13:54 +02:00
Michal Čihař 7f07a54e26 Configure temp file for bigger uploads
Issue #32

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:13:16 +02:00
Michal Čihař 4b12fdda7c Disable fastcgi buffering
We can immedieately send out fastcgi response.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:11:48 +02:00
Michal Čihař 0ffb4af4c4 Increase maximal execution time
- This is needed to allow big SQL uploads.
- Also keep in sync nginx and PHP limit.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:06:29 +02:00
Michal Čihař a76914f87d Increase nginx buffers and maximal request size
We can expect people posting big SQL files, so let's allow 128M.

Issue #32

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:05:12 +02:00
Michal Čihař 0c3251bf9e Disable environment cleanup on PHP FPM
We pass settings by environment, so it has to be preserved.

Fixes #49

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 19:21:40 +02:00
Michal Čihař 8bec114378 Adjust description to match current setup
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:21:52 +02:00
Michal Čihař d6be2b9f1a Fix syntax
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:12:39 +02:00
Michal Čihař 32d4928e0a Always test against latest versions of databases
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:11:52 +02:00
Michal Čihař 978bdb4b25 Display logs only on error
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:09:40 +02:00
Michal Čihař 5b5edcafb1 Remove debugging code
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:08:17 +02:00
Michal Čihař d784d12452 Fix permissions on start
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:02:57 +02:00
Michal Čihař 84493eb5e4 Fix sessions permissions
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 09:54:34 +02:00
Michal Čihař 91b5bd0fcd Merge branch 'nginx' 2016-08-28 09:47:36 +02:00
Michal Čihař a1c139f901 Debug failures
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 09:47:09 +02:00
Michal ČihařandGitHub 507105ec70 Merge pull request #48 from nijel/nginx
Use supervisor +  nginx + php-fpm
2016-08-28 09:18:28 +02:00
Michal Čihař feb1c92581 Remove debugging settings
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 09:17:59 +02:00
Michal Čihař d12c0493ee Improve sessions configuration
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 09:10:37 +02:00
Michal Čihař 00ff178fd1 Add php.ini configuration file
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 09:09:03 +02:00
Michal Čihař b611c5adde Display logs at the end of test
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-27 13:29:48 +02:00
Michal Čihař 1b2ff90941 Better name for docker-compose
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-27 13:24:55 +02:00
Michal Čihař 5cb63716a7 Move tests to separate script
We repeat same for every container anyway.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-27 13:24:55 +02:00
Michal Čihař d70630f09a Initial attempt to use nginx + php-fpm
Replaced php built in server with supervisord + nginx + php-fpm.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-27 13:24:55 +02:00
Michal Čihař 9e0529c6f5 Revert "Remove PMA_ABSOLUTE_URI as it is no longer needed with 4.6"
This reverts commit 812590e038.

Fixes #40

Please note that the setting will take no effect till phpMyAdmin 4.6.5.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-17 15:43:28 +02:00
Michal Čihař e7d5c0f075 Add comments to Dockerfile
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-17 11:00:34 +02:00
Michal Čihař 690acf54dd Document what credentials are used, it seems to be common problem of users
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-17 10:36:42 +02:00
Michal Čihař 901156a7eb Update to 4.6.4
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-17 10:31:36 +02:00
Michal Čihař ced6ab371a Disable apk cache for removal
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-08 14:09:08 +02:00
Michal ČihařandGitHub 9d258fed4f Merge pull request #46 from nijel/master
Specify version in variable
2016-08-08 14:08:40 +02:00
Michal Čihař e59a8bab47 Specify version in variable
This way we can reproduce build of tags, with latest approach used so
far, you would always get the latest version even when building older
tag.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-08 14:05:53 +02:00
Michal Čihař c099349ef3 Remove not needed curl installation
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-08 13:52:48 +02:00
Michal ČihařandGitHub a602d1d4c6 Merge pull request #45 from nijel/pgp
Verify downloaded tarball using PGP
2016-08-08 13:47:24 +02:00
Michal Čihař 8a8e9eee0a Verify downloaded tarball using PGP
Fixes #43

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-08 13:44:21 +02:00
Michal Čihař a5dfdfe993 Move user configuration and simplify it's setup
- move it to root directory to make it easier to use as volume

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-08 13:09:32 +02:00
Michal Čihař f67529f585 Merge remote-tracking branch 'origin/pull/42' 2016-08-08 12:56:21 +02:00
Michal Čihař e6bc219529 Fix link to docs
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-26 20:29:10 +02:00
Michal Čihař ef53180e08 Increase number of chars allowed in secret
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-26 11:56:47 +02:00
Douglas Wagner 4cadf08f00 Updated for installing config.userdef.inc.php hook to update PHPMYADMIN custom user setttings without modifying/overriding the config.inc.php file. 2016-07-11 12:49:04 -05:00
Michal Čihař e713caa214 Remove mcrypt from dependencies, it is not needed with openssl
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-14 15:45:56 +02:00
Michal Čihař cce91f08d4 Revert "Switch to PHP 7"
Okay, the PHP 7 packages are not yet in released Alpine, we need to wait
for next release.

This reverts commit 9d0dec3d2e.
2016-06-14 15:45:15 +02:00
Michal Čihař 9d0dec3d2e Switch to PHP 7
Fixes #34

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-14 15:41:18 +02:00
Michal ČihařandGitHub 563bcafcec Merge pull request #36 from ssteinerx/Update-base-image-to-Alpine-3.4
Update base image to alpine:latest
2016-06-14 15:39:32 +02:00
Steve SteinerandGitHub 0bc8b4025b Update base image to alpine:latest
As per note in previous version of Dockerfile to switch when 3.4 was out.

Also removed comment since it's done.
2016-06-14 09:34:55 -04:00
Michal Čihař 812590e038 Remove PMA_ABSOLUTE_URI as it is no longer needed with 4.6
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-10 13:49:55 +02:00
Michal Čihař 7d6f729bc6 Fix PHP configuration name
Fixes #32

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-10 12:34:58 +02:00
Michal Čihař 593d7f5f96 Include PHP modules for bz2 and zip
Fixes #33

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-10 12:34:01 +02:00
Michal Čihař ae243b8077 Add test for sessions after shutdown (issue #32)
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-06 10:16:08 +02:00
Michal Čihař 96e3c94c6b Try testing docker compose as well
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-06 10:10:28 +02:00
Michal Čihař 23cb076766 Use persistent volume for sessions
Issue #32

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-06 10:03:35 +02:00
Michal Čihař 15ca16c9d0 Change deps to php5
We would really prefer php7, but it's not there and php packages got
renamed to php5

Issue #31

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-27 13:48:21 +02:00
Michal Čihař 12997cea47 Document where bug reports on phpMyAdmin should go
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-27 09:59:50 +02:00
Michal Čihař 249e10decc Add comment why is there edge
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-20 08:34:17 +02:00
Michal Čihař 6dd6b90902 Base on alpine:edge to get DNS fixes
See https://twitter.com/thockin/status/704909611279781888 and
https://github.com/gliderlabs/docker-alpine/issues/8. This will be fixed
in 3.4, so at that point we can switch back to using stable.

Fixes #23 (DNS issues)
Fixes #27 (Kubernetes support)

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-20 08:31:53 +02:00
Michal Čihař 4893806cde More links to docker hub
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-20 08:31:11 +02:00
Michal Čihař f313ce3a84 Add docker badge
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-20 08:24:42 +02:00
34 changed files with 7142 additions and 95 deletions
-6
View File
@@ -1,6 +0,0 @@
.travis.yml
docker-compose.yml
docker-compose.testing.yml
README.md
LICENSE
Makefile
+4
View File
@@ -0,0 +1,4 @@
This repository contains only Docker integration of phpMyAdmin.
Please do not report bugs in phpMyAdmin itself here, use
<https://github.com/phpmyadmin/phpmyadmin/issues> instead.
+23
View File
@@ -0,0 +1,23 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale Issue or Pull Request is closed
daysUntilClose: 7
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- pinned
- security
# Label to use when marking as stale
staleLabel: wontfix
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when removing the stale label. Set to `false` to disable
unmarkComment: false
# Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable
closeComment: false
# Limit to only `issues` or `pulls`
only: pulls
+84 -30
View File
@@ -1,36 +1,90 @@
sudo: required
services:
- docker
env:
matrix:
- DB=mysql:5.7
- DB=mariadb:10.0
language: python
python: 2.7
dist: bionic
stages:
- name: "Build images"
- name: "Test docker-compose"
- name: "Run tests in testing container"
before_install:
- docker run --name db_server -e MYSQL_ROOT_PASSWORD=my-secret-pw -d $DB
- export TESTSUITE_PASSWORD=`openssl rand -base64 30`
- docker run --name db_server -e MYSQL_ROOT_PASSWORD=$TESTSUITE_PASSWORD -v $PWD/testing/testing.cnf:/etc/mysql/conf.d/testing.cnf:ro -d $DB
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
- docker ps -a
- curl http://127.0.0.1:9090/ | grep -q input_password
- curl --cookie-jar /tmp/cj --location -d pma_username=root -d pma_password=my-secret-pw -d server=1 http://127.0.0.1:9090/ | grep -r 'db via TCP'
# Test for single database using env
- docker run --name envadmin -d --link db_server:db2 -e PMA_HOST=db2 -p 6060:80 phpmyadmin/phpmyadmin
- docker ps -a
- curl http://127.0.0.1:6060/ | grep -q input_password
- curl --cookie-jar /tmp/cj --location -d pma_username=root -d pma_password=my-secret-pw -d server=1 http://127.0.0.1:6060/ | grep -r 'db2 via TCP'
# Test for arbitrary database
- docker run --name arbitraryadmin -d --link db_server:db -e PMA_ARBITRARY=1 -p 7070:80 phpmyadmin/phpmyadmin
- docker ps -a
- curl http://127.0.0.1:7070/ | grep -q input_password
- curl --cookie-jar /tmp/cj --location -d pma_servername=db -d pma_username=root -d pma_password=my-secret-pw -d server=1 http://127.0.0.1:7070/ | grep -r 'db via TCP'
# Test docker-compose
- docker-compose up -d
- docker ps -a
- curl http://127.0.0.1:8080/ | grep -q input_password
- docker-compose stop
install:
- pip install mechanize html5lib
_helpers:
- &test-docker-compose
stage: "Test docker-compose"
script:
- docker-compose -f docker-compose.testing.yml up -d db_server
- docker-compose -f docker-compose.testing.yml up -d
- docker-compose exec phpmyadmin /test-docker.sh phpmyadmin_testing 80 phpmyadmin_testing_db
- docker-compose stop
- &test-apache-image
stage: "Run tests in testing container"
script:
# Build image
- docker build -t phpmyadmin/phpmyadmin apache
# 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-db
stage: "Test docker-compose"
script:
- docker-compose -f docker-compose.yml -f docker-compose.db.yml up -d
- ./testing/test-docker.sh phpmyadmin 8080 db_server
- docker-compose stop
- &build-image
stage: "Build images"
before_install: skip
install: skip
jobs:
include:
- <<: *test-docker-compose
name: "Run and stop container using testing docker-compose file for MariaDB"
env: DB=mariadb:latest
- <<: *test-docker-compose
name: "Run and stop container using testing docker-compose file for MySQL"
env: DB=mysql:latest
- <<: *test-docker-compose-db
name: "Run and stop container using db docker-compose file for MariaDB"
env: DB=mariadb:latest
- <<: *test-docker-compose-db
name: "Run and stop container using db docker-compose file for MySQL"
env: DB=mysql:latest
- <<: *build-image
name: "Apache amd64"
arch: amd64
script:
- docker build -t phpmyadmin/phpmyadmin apache
- <<: *build-image
name: "fpm amd64"
arch: amd64
script:
- docker build -t phpmyadmin/phpmyadmin fpm
- <<: *build-image
name: "fpm-alpine amd64"
arch: amd64
script:
- docker build -t phpmyadmin/phpmyadmin fpm-alpine
- <<: *test-apache-image
name: "Run testing for MariaDB"
env: DB=mariadb:latest
- <<: *test-apache-image
name: "Run testing for MySQL"
env: DB=mysql:latest
-18
View File
@@ -1,18 +0,0 @@
FROM alpine
RUN apk add --no-cache php-cli php-mysqli php-ctype php-xml php-gd php-zlib php-openssl php-curl php-opcache php-json php-mcrypt curl
RUN curl --location https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz | tar xzf - \
&& mv phpMyAdmin* /www \
&& rm -rf /www/js/jquery/src/ /www/examples /www/po/
COPY config.inc.php /www/
COPY run.sh /run.sh
RUN chmod u+rwx /run.sh
EXPOSE 80
ENV PHP_UPLOAD_MAX_FILESIZE=64M \
PHP_MAX_INPUT_VARS=2000
ENTRYPOINT [ "/run.sh" ]
+92
View File
@@ -0,0 +1,92 @@
FROM php:7.2-%%VARIANT%%
# docker-entrypoint.sh dependencies
RUN apk add --no-cache \
bash
# 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 \
; \
\
docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr; \
docker-php-ext-install 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 .build-deps
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
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'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly = 1'; \
echo 'session.use_strict_mode = 1'; \
} > /usr/local/etc/php/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen = Off'; \
echo 'max_execution_time = 600'; \
echo 'memory_limit = 512M'; \
} > /usr/local/etc/php/conf.d/phpmyadmin-misc.ini
# Calculate download URL
ENV VERSION %%VERSION%%
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL version=$VERSION
# 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 --output phpMyAdmin.tar.xz --location $URL; \
curl --output phpMyAdmin.tar.xz.asc --location $URL.asc; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver ipv4.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.gnupg.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /usr/src; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
mv /usr/src/phpMyAdmin-$VERSION-all-languages /usr/src/phpmyadmin; \
rm -rf /usr/src/phpmyadmin/setup/ /usr/src/phpmyadmin/examples/ /usr/src/phpmyadmin/test/ /usr/src/phpmyadmin/po/ /usr/src/phpmyadmin/composer.json /usr/src/phpmyadmin/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /usr/src/phpmyadmin/libraries/vendor_config.php; \
# Add directory for sessions to allow session persistence
mkdir /sessions; \
mkdir -p /var/nginx/client_body_temp; \
apk del .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%%"]
+100
View File
@@ -0,0 +1,100 @@
FROM php:7.2-%%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 \
; \
\
docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr; \
docker-php-ext-install 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
RUN { \
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'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly = 1'; \
echo 'session.use_strict_mode = 1'; \
} > /usr/local/etc/php/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen = Off'; \
echo 'max_execution_time = 600'; \
echo 'memory_limit = 512M'; \
} > /usr/local/etc/php/conf.d/phpmyadmin-misc.ini
# Calculate download URL
ENV VERSION %%VERSION%%
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL version=$VERSION
# Download tarball, verify it using gpg and extract
RUN set -ex; \
fetchDeps=" \
gnupg \
dirmngr \
"; \
apt-get update; \
apt-get install -y --no-install-recommends $fetchDeps; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl --output phpMyAdmin.tar.xz --location $URL; \
curl --output phpMyAdmin.tar.xz.asc --location $URL.asc; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver ipv4.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.gnupg.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /usr/src; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
mv /usr/src/phpMyAdmin-$VERSION-all-languages /usr/src/phpmyadmin; \
rm -rf /usr/src/phpmyadmin/setup/ /usr/src/phpmyadmin/examples/ /usr/src/phpmyadmin/test/ /usr/src/phpmyadmin/po/ /usr/src/phpmyadmin/composer.json /usr/src/phpmyadmin/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /usr/src/phpmyadmin/libraries/vendor_config.php; \
# Add directory for sessions to allow session persistence
mkdir /sessions; \
mkdir -p /var/nginx/client_body_temp; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
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%%"]
+10 -5
View File
@@ -1,14 +1,19 @@
DOCKER_REPO = phpmyadmin/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
+80 -5
View File
@@ -1,12 +1,48 @@
# Official phpMyAdmin Docker image
Run phpMyAdmin with Alpine and PHP built in web server.
Run phpMyAdmin with Alpine, supervisor, nginx and PHP FPM.
[![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")
All 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.
The official MySQL and MariaDB use 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
You can use following tags on Docker hub:
* `latest` - latest stable release
* `4.8` - latest stable release for the 4.8 version
* `4.8.5` - specific patch release for the 4.8 version
For each tag the following variants are provided:
### apache
This starts an Apache webserver with PHP, so you can use phpMyAdmin out of the box.
### fpm-alpine
This image has a very small footprint. It is based on Alpine Linux and starts only a PHP FPM process. Use this variant if you already have a seperate webserver. If you need more tools, that are not available on Alpine Linux, use the fpm image instead.
### fpm
This image starts only a PHP FPM container. Use this variant if you already have a seperate webserver.
## Usage with linked server
@@ -31,7 +67,7 @@ docker run --name myadmin -d -e PMA_HOST=dbhost -p 8080:80 phpmyadmin/phpmyadmin
You can use arbitrary servers by adding ENV variable `PMA_ARBITRARY=1` to the startup command:
```
docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 -e PMA_ARBITRARY=1 phpmyadmin/phpmyadmin
docker run --name myadmin -d -e PMA_ARBITRARY=1 -p 8080:80 phpmyadmin/phpmyadmin
```
## Usage with docker-compose and arbitrary server
@@ -45,18 +81,57 @@ Using the docker-compose.yml from https://github.com/phpmyadmin/docker
docker-compose up -d
```
## 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
```
## 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
in it, and then linking it into the container using:
```
-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
```
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 reverse proxys
Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma.example.net/``) where the reverse proxy makes phpMyAdmin available.
## Environment variables summary
* ``PMA_ARBITRARY`` - when set to 1 connection to the arbitrary server will be allowed
* ``PMA_HOST`` - define address/host name of the MySQL server
* ``PMA_VERBOSE`` - define verbose name of the MySQL server
* ``PMA_PORT`` - define port of the MySQL server
* ``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
* ``PHP_UPLOAD_MAX_FILESIZE`` - define upload_max_filesize and post_max_size PHP settings
* ``PHP_MAX_INPUT_VARS`` - define max_input_vars PHP setting
For more detailed documentation see http://docs.phpmyadmin.net/en/latest/setup.html#installing-using-docker
For usage with Docker secrets, appending ``_FILE`` to any environment variable is allowed:
```
docker run --name myadmin -d -e PMA_PASSWORD_FILE=/run/secrets/db_password.txt -p 8080:80 phpmyadmin/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/
Please report any issues with the Docker container to https://github.com/phpmyadmin/docker/issues
+100
View File
@@ -0,0 +1,100 @@
FROM php:7.2-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 \
; \
\
docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr; \
docker-php-ext-install 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
RUN { \
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'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly = 1'; \
echo 'session.use_strict_mode = 1'; \
} > /usr/local/etc/php/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen = Off'; \
echo 'max_execution_time = 600'; \
echo 'memory_limit = 512M'; \
} > /usr/local/etc/php/conf.d/phpmyadmin-misc.ini
# Calculate download URL
ENV VERSION 4.9.1
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL version=$VERSION
# Download tarball, verify it using gpg and extract
RUN set -ex; \
fetchDeps=" \
gnupg \
dirmngr \
"; \
apt-get update; \
apt-get install -y --no-install-recommends $fetchDeps; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl --output phpMyAdmin.tar.xz --location $URL; \
curl --output phpMyAdmin.tar.xz.asc --location $URL.asc; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver ipv4.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.gnupg.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /usr/src; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
mv /usr/src/phpMyAdmin-$VERSION-all-languages /usr/src/phpmyadmin; \
rm -rf /usr/src/phpmyadmin/setup/ /usr/src/phpmyadmin/examples/ /usr/src/phpmyadmin/test/ /usr/src/phpmyadmin/po/ /usr/src/phpmyadmin/composer.json /usr/src/phpmyadmin/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /usr/src/phpmyadmin/libraries/vendor_config.php; \
# Add directory for sessions to allow session persistence
mkdir /sessions; \
mkdir -p /var/nginx/client_body_temp; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
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"]
+137
View File
@@ -0,0 +1,137 @@
<?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'
);
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']);
}
/* 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'] = '';
/* 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 [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi
chown www-data:www-data /sessions /var/nginx/client_body_temp
if ! [ -e index.php -a -e db_designer.php ]; then
echo >&2 "phpMyAdmin not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar --create \
--file - \
--one-file-system \
--directory /usr/src/phpmyadmin \
--owner "$user" --group "$group" \
. | tar --extract --file -
echo >&2 "Complete! phpMyAdmin has been successfully copied to $PWD"
mkdir -p tmp; \
chmod -R 777 tmp; \
fi
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
exec "$@"
+84 -10
View File
@@ -1,22 +1,37 @@
<?php
require('./config.secret.inc.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_ABSOLUTE_URI',
'PMA_CONTROLHOST',
'PMA_CONTROLPORT',
'PMA_PMADB',
'PMA_CONTROLUSER',
'PMA_CONTROLPASS',
'PMA_QUERYHISTORYDB'
);
foreach ($vars as $var) {
if (!isset($_ENV[$var]) && getenv($var)) {
$_ENV[$var] = getenv($var);
$env = getenv($var);
if (!isset($_ENV[$var]) && $env !== false) {
$_ENV[$var] = $env;
}
}
if (isset($_ENV['PMA_QUERYHISTORYDB'])) {
$cfg['QueryHistoryDB'] = boolval($_ENV['PMA_QUERYHISTORYDB']);
}
/* Arbitrary server connection */
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
@@ -36,28 +51,87 @@ $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']);
$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($_ENV['PMA_PORT'])) {
$cfg['Servers'][$i]['port'] = $_ENV['PMA_PORT'];
if (isset($verbose[$i - 1])) {
$cfg['Servers'][$i]['verbose'] = $verbose[$i - 1];
}
if (isset($_ENV['PMA_USER'])) {
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'] : null;
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : '';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
$cfg['Servers'][$i]['connect_type'] = 'tcp';
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'] = '';
/* Include User Defined Settings Hook */
if (file_exists('/etc/phpmyadmin/config.user.inc.php')) {
include('/etc/phpmyadmin/config.user.inc.php');
}
+3
View File
@@ -0,0 +1,3 @@
phpmyadmin:
external_links:
- db_server:db
+24 -6
View File
@@ -1,8 +1,26 @@
phpmyadmin:
image: phpmyadmin/phpmyadmin:testing
container_name: myadmin
version: '2'
services:
db_server:
image: ${DB}
container_name: phpmyadmin_testing_db
environment:
- PMA_ARBITRARY=1
restart: always
- MYSQL_ROOT_PASSWORD=${TESTSUITE_PASSWORD}
volumes:
- ./testing/testing.cnf:/etc/mysql/conf.d/testing.cnf:ro
phpmyadmin:
build:
context: testing/
links:
- db_server:db_server
container_name: phpmyadmin_testing
volumes:
- /sessions
ports:
- 8090:80
- 8090:80
environment:
- PMA_ARBITRARY=1
- TESTSUITE_PASSWORD=${TESTSUITE_PASSWORD}
depends_on:
- db_server
+3 -1
View File
@@ -1,8 +1,10 @@
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: myadmin
container_name: phpmyadmin
environment:
- PMA_ARBITRARY=1
restart: always
ports:
- 8080:80
volumes:
- /sessions
+50
View File
@@ -0,0 +1,50 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi
chown www-data:www-data /sessions /var/nginx/client_body_temp
if ! [ -e index.php -a -e db_designer.php ]; then
echo >&2 "phpMyAdmin not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar --create \
--file - \
--one-file-system \
--directory /usr/src/phpmyadmin \
--owner "$user" --group "$group" \
. | tar --extract --file -
echo >&2 "Complete! phpMyAdmin has been successfully copied to $PWD"
mkdir -p tmp; \
chmod -R 777 tmp; \
fi
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
exec "$@"
+92
View File
@@ -0,0 +1,92 @@
FROM php:7.2-fpm-alpine
# docker-entrypoint.sh dependencies
RUN apk add --no-cache \
bash
# 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 \
; \
\
docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr; \
docker-php-ext-install 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 .build-deps
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
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'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly = 1'; \
echo 'session.use_strict_mode = 1'; \
} > /usr/local/etc/php/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen = Off'; \
echo 'max_execution_time = 600'; \
echo 'memory_limit = 512M'; \
} > /usr/local/etc/php/conf.d/phpmyadmin-misc.ini
# Calculate download URL
ENV VERSION 4.9.1
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL version=$VERSION
# 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 --output phpMyAdmin.tar.xz --location $URL; \
curl --output phpMyAdmin.tar.xz.asc --location $URL.asc; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver ipv4.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.gnupg.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /usr/src; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
mv /usr/src/phpMyAdmin-$VERSION-all-languages /usr/src/phpmyadmin; \
rm -rf /usr/src/phpmyadmin/setup/ /usr/src/phpmyadmin/examples/ /usr/src/phpmyadmin/test/ /usr/src/phpmyadmin/po/ /usr/src/phpmyadmin/composer.json /usr/src/phpmyadmin/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /usr/src/phpmyadmin/libraries/vendor_config.php; \
# Add directory for sessions to allow session persistence
mkdir /sessions; \
mkdir -p /var/nginx/client_body_temp; \
apk del .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"]
+137
View File
@@ -0,0 +1,137 @@
<?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'
);
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']);
}
/* 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'] = '';
/* 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 [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi
chown www-data:www-data /sessions /var/nginx/client_body_temp
if ! [ -e index.php -a -e db_designer.php ]; then
echo >&2 "phpMyAdmin not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar --create \
--file - \
--one-file-system \
--directory /usr/src/phpmyadmin \
--owner "$user" --group "$group" \
. | tar --extract --file -
echo >&2 "Complete! phpMyAdmin has been successfully copied to $PWD"
mkdir -p tmp; \
chmod -R 777 tmp; \
fi
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
exec "$@"
+100
View File
@@ -0,0 +1,100 @@
FROM php:7.2-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 \
; \
\
docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr; \
docker-php-ext-install 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
RUN { \
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'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly = 1'; \
echo 'session.use_strict_mode = 1'; \
} > /usr/local/etc/php/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen = Off'; \
echo 'max_execution_time = 600'; \
echo 'memory_limit = 512M'; \
} > /usr/local/etc/php/conf.d/phpmyadmin-misc.ini
# Calculate download URL
ENV VERSION 4.9.1
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL version=$VERSION
# Download tarball, verify it using gpg and extract
RUN set -ex; \
fetchDeps=" \
gnupg \
dirmngr \
"; \
apt-get update; \
apt-get install -y --no-install-recommends $fetchDeps; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl --output phpMyAdmin.tar.xz --location $URL; \
curl --output phpMyAdmin.tar.xz.asc --location $URL.asc; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver ipv4.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.gnupg.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /usr/src; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
mv /usr/src/phpMyAdmin-$VERSION-all-languages /usr/src/phpmyadmin; \
rm -rf /usr/src/phpmyadmin/setup/ /usr/src/phpmyadmin/examples/ /usr/src/phpmyadmin/test/ /usr/src/phpmyadmin/po/ /usr/src/phpmyadmin/composer.json /usr/src/phpmyadmin/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /usr/src/phpmyadmin/libraries/vendor_config.php; \
# Add directory for sessions to allow session persistence
mkdir /sessions; \
mkdir -p /var/nginx/client_body_temp; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
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"]
+137
View File
@@ -0,0 +1,137 @@
<?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'
);
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']);
}
/* 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'] = '';
/* 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 [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi
chown www-data:www-data /sessions /var/nginx/client_body_temp
if ! [ -e index.php -a -e db_designer.php ]; then
echo >&2 "phpMyAdmin not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar --create \
--file - \
--one-file-system \
--directory /usr/src/phpmyadmin \
--owner "$user" --group "$group" \
. | tar --extract --file -
echo >&2 "Complete! phpMyAdmin has been successfully copied to $PWD"
mkdir -p tmp; \
chmod -R 777 tmp; \
fi
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
exec "$@"
+97
View File
@@ -0,0 +1,97 @@
#!/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;
}
')
)
}
# depends on docker library
#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 }}"'
# ) )"
#}
#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>
Michal Čihař <michal@cihar.com>
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="$(
git ls-remote --tags https://github.com/phpmyadmin/phpmyadmin.git \
| cut -d/ -f3 \
| grep -vE -- '-rc|-b' \
| sort -V \
| tail -1
)"
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")"
# depends on docker library
#variantArches="${parentRepoToArches[$variantParent]}"
variantArches="amd64 arm32v7 arm64v8 i386 ppc64le"
cat <<-EOE
Tags: $(join ', ' "${variantAliases[@]}")
Architectures: $(join ', ' $variantArches)
GitCommit: $commit
Directory: $variant
EOE
done
-14
View File
@@ -1,14 +0,0 @@
#!/bin/sh
set -x
if [ ! -f /www/config.secret.inc.php ] ; then
cat > /www/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`';
EOT
fi
exec php -S 0.0.0.0:80 -t /www/ \
-d upload_max_filesize=$PHP_UPLOAD_MAX_FILESIZE \
-d post_max_size=$PHP_UPLOAD_MAX_FILESIZE \
-d max_input_vars=$PHP_MAX_INPUT_VARS
+16
View File
@@ -0,0 +1,16 @@
# Testing image for phpMyAdmin
FROM phpmyadmin/phpmyadmin
# Install test dependencies
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
curl \
python-pip \
; \
pip install mechanize html5lib; \
rm -rf /var/lib/apt/lists/*
COPY phpmyadmin_test.py test-docker.sh world.sql /
+2
View File
@@ -0,0 +1,2 @@
<?php
$cfg['AllowArbitraryServer'] = true;
+73
View File
@@ -0,0 +1,73 @@
#!/usr/bin/env python2
import argparse
import os
import re
import sys
import mechanize
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'
elif os.path.exists('./world.sql'):
sqlfile = './world.sql'
else:
sqlfile = './testing/world.sql'
br = mechanize.Browser()
# Ignore robots.txt
br.set_handle_robots(False)
# Login page
br.open(url)
# Fill login form
br.select_form('login_form')
br['pma_username'] = username
br['pma_password'] = password
if server is not None:
br['pma_servername'] = server
# Login and check if loggged in
response = br.submit()
test_content('Server version', response.read())
# Open server import
response = br.follow_link(text_regex=re.compile('Import'))
test_content('OpenDocument Spreadsheet', 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())
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()
test_phpmyadmin(
args.url,
args.username,
args.password,
args.server,
args.sqlfile
)
if __name__ == '__main__':
main()
+89
View File
@@ -0,0 +1,89 @@
#!/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
PHPMYADMIN_HOSTNAME=${TESTSUITE_HOSTNAME:=localhost}
PHPMYADMIN_PORT=${TESTSUITE_PORT:=80}
PHPMYADMIN_URL=http://$PHPMYADMIN_HOSTNAME:$PORT/
# Set database environment
PHPMYADMIN_DB_HOSTNAME=${PMA_HOST:=localhost}
PHPMYADMIN_DB_PORT=${PMA_PORT:=3306}
# Color text output
GREEN="\033[0;32m"
RED="\033[0;31m"
NC="\033[0m" # No Color
# Find test script
if [ -f ./phpmyadmin_test.py ] ; then
FILENAME=./phpmyadmin_test.py
else
FILENAME=./testing/phpmyadmin_test.py
fi
# Check if script is running inside container
if ! [ -f /.dockerenv ] ; then
echo "Tests running outside container..."
COMMAND_HOST="docker exec ${NAME}"
docker ps -a
# Wait for database to start
TIMEOUT=0
while [ $(docker logs db_server 2>&1 | fgrep -c "mysqld: ready for connections.") -le 0 ] ; 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}"
docker logs ${NAME}
exit 1
fi
done
# Wait for container to start
TIMEOUT=0
while [ $(docker logs ${NAME} 2>&1 | fgrep -c "Command line: 'apache2 -D FOREGROUND'") -le 0 ] ; 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}"
docker logs ${NAME}
exit 1
fi
done
else
echo "Tests running inside container..."
FILENAME=/phpmyadmin_test.py
fi
# Perform tests
ret=0
$FILENAME --url "$PHPMYADMIN_URL" --username root --password $TESTSUITE_PASSWORD $SERVER
ret=$?
# Show debug output in case of failure
if [ $ret -ne 0 ] ; then
curl "$PHPMYADMIN_URL"
${COMMAND_HOST} ps faux
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: ${RED}FAILED${NC}"
exit $ret
fi
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: ${GREEN}SUCCESS${NC}"
+11
View File
@@ -0,0 +1,11 @@
[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
@@ -0,0 +1,11 @@
[program:test-mysql]
command=/test-docker.sh test 80 db_server
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
+5395
View File
File diff suppressed because it is too large Load Diff
Executable
+36
View File
@@ -0,0 +1,36 @@
#!/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')"
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/%%VARIANT%%/'"$variant"'/;
s/%%CMD%%/'"${cmd[$variant]}"'/;
' "$variant/Dockerfile"
done