Giter VIP home page Giter VIP logo

docker-phpmyadmin's Introduction

Docker pulls Docker stars

phpMyAdmin as Docker container

This container may be used with MySQL or MariaDB linked containers.

If you like this image - you may also like set of images for WebServer.

How to use

With MySQL:

docker run --name mysql -e MYSQL_ROOT_PASSWORD=my_password -d mysql
docker run --rm --link mysql:mysql -p 1234:80 nazarpc/phpmyadmin

With MariaDB:

docker run --name mariadb -e MYSQL_ROOT_PASSWORD=my_password -d mariadb
docker run --rm --link mariadb:mysql -p 1234:80 nazarpc/phpmyadmin

(internally it should be called mysql anyway)

After these commands you'll be able to access phpMyAdmin via http://localhost:1234, press Ctrl+C to stop container, and it will be removed automatically (because of --rm option). Feel free to change 1234 to any port you like.

Specify allowed upload file size

Sometimes it is necessary to upload big dump which doesn't fit into default limit 128M. You can specify alternative size via environment variable UPLOAD_SIZE:

docker run --rm --link mysql:mysql -p 1234:80 -e UPLOAD_SIZE=1G nazarpc/phpmyadmin

Increase session timeout

The default session timeout is just 1440 seconds (24 minutes). You can specify an alternative timeout by setting the environment variable SESSION_TIMEOUT:

docker run --rm --link mysql:mysql -p 1234:80 -e SESSION_TIMEOUT=86400 nazarpc/phpmyadmin

Customize host name

By default phpMyAdmin assumes MySQL is available through mysql hostname. Sometimes this is not the case, so you can override this with environmental variable MYSQL_HOST:

docker run --rm --link mysql:mysql -p 1234:80 -e MYSQL_HOST=mariadb:9999 nazarpc/phpmyadmin

Examples of valid MYSQL_HOST:

  • mariadb - hostname mariadb
  • mariadb:9999 - hostname mariadb with port 9999
  • mariadb;root - hostname mariadb with user root
  • mariadb;root;123 - hostname mariadb with user root & password 123
  • mariadb:9999;root;123 - hostname mariadb with user root, password 123 & port 9999
  • mysql, mariadb:9999, mariadb:9999;root;123 - multiple servers

Allow connecting to arbitrary MySQL host

docker run --rm --link mysql:mysql -p 1234:80 -e ALLOW_ARBITRARY=1 nazarpc/phpmyadmin

Custom URI of phpMyAdmin instance

Sometimes phpMyAdmin may determine its own URI incorrectly. Usually you can fix it by correcting virtual host of revers proxy, but sometimes it might be useful to specify URI explicitly:

docker run --rm --link mysql:mysql -p 1234:80 -e ABSOLUTE_URI=https://domain.tld/phpmyadmin nazarpc/phpmyadmin

Custom phpMyAdmin settings

You can specify any PMA-config-setting using a JSON object passed to JSON_CONFIG, that will be merged to the existing config.

docker run --rm --link mysql:mysql -p 1234:80 -e JSON_CONFIG='{"AllowUserDropDatabase": true,"MaxTableList": 450, "NavigationTreeTableSeparator": "_"}' nazarpc/phpmyadmin

Custom ports for HTTP and HTTPS inside the container

If you need Apache to listen on ports other than the default 80 and 443 (e.g. when running the container with a non-privileged user) specify alternative values via the environment variables HTTP_PORT and HTTPS_PORT:

docker run --rm --user 1001 -p 8080:8080 -p 4443:4443 -e HTTP_PORT=8080 -e HTTPS_PORT=4443 nazarpc/phpmyadmin

Difference from other similar images with phpMyAdmin

This image doesn't use any custom base, just official PHP 7.2 container with built-in Apache2 web server. There is support for importing SQL dumps in all compression formats supported by phpMyAdmin. There is possibility to connect to multiple servers of your choice or even to arbitrary servers if necessary.

Also this image generates blowfish_secret configuration option (unique for each container instance, you don't have to rebuild it yourself) on each container start, so that you will automatically use cookie sessions (for your convenience).

Plus, I'll try to keep it up to date with new releases of phpMyAdmin (as well as PHP itself and other software inside image), so, by using nazarpc/phpmyadmin image you'll always have latest versions.

Note: This image is ready for running on OpenShift, which runs the container using a non-privileged user. You'll need to specify unprivileged ports for Apache (see above).

Questions?

Open an issue and ask your question there.

License

Public Domain

docker-phpmyadmin's People

Contributors

bittner avatar davidwindell avatar echernyavskiy avatar francisbesset avatar hatemjerbi avatar nazar-pc avatar philhug avatar skyred avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-phpmyadmin's Issues

Upgrade to PHP7

It would be great to see an upgrade to PHP7 as 5.6 is no longer supported.

Adding tags to the image on docker hub

Hello,

First, thanks for providing this image, it's really helpful !

I'm using this image in an automated deployment playbook (with Ansible). In that scope, it would be nice to be able to pull the exact same image at each execution of the playbook, in order to have a predictible and reproductible environment. The fact that 'latest' is the only tag available for this image prevent that.

Would it be possible to tag the images pushed on docker hub with the phpmyadmin version ?

Thanks in advance

Increase default timeout

Is it possible to provide an ENV var to specify the default timeout?

I think this is called LoginCookieValidity in config.inc.php

Increase max_execution_time

I want to import a quite large file into mysql and would need to increase max_execution_time. Is there a way to do so?

Consider GPL v3 or MIT license

According to the README this project source code is in the Public Domain.

You may want to consider putting it under GPL v3 or, at least, the MIT license.

The former would ensure that the code remains free/libre forever, the latter that you're not liable for potential damages caused by the code.

See also GitHub's guide on licenses.

Compatibility with OpenShift container platform

We're using this image for our customers who want to run phpMyAdmin on OpenShift. OpenShift requires the user running inside the container not to be root (to avoid privileged access to the host machine).

We've made the necessary adaptions, following the proposed changes of the OpenShift documentation, in our own image.

Would you like those changes integrated in your entrypoint? We could introduce new environment variables, e.g.

  • HTTP_PORT=80
  • HTTPS_PORT=443

... and the group ownership could be root by default in the Dockerfile, which probably wouldn't harm.

This way users wanting to run on OpenShift may simply set the two environment variables from above (plus MYSQL_HOST, probably), and all would be good. No dedicated Docker image required!

How does that sound? Would you accept such a PR?

Redirecting to / on login, not taking in account ABSOLUTE_URI

Hi,

I recently upgraded to the latest version of the image (I was previously using 4.6.1 I think), and since this upgrade I have an annoying issue when logging into phpmyadmin.

My phpmyadmin is proxied from an apache an lies on https://xxxx/phpmyadmin/, it used to work just fine, but since the upgrade it now redirect automatically after the login to https://xxx/. I have to manually go back to /phpmyadmin/.

Any idea on why this happens ?

Thanks !

How to access via https?

I've set up HTTPS_PORT environment variable and also paired local port with container port. However I'm still unable to access phpMyAdmin via https, it seems https port on the container is actually not opened.
What do I do wrong?

Openshift 3.9: Unable to open logs

Hello, I'm trying to deploy your image. This is my curent output:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.11.135. Set the 'ServerName' directive globally to suppress this message
--
  | (13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
  | (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
  | no listening sockets available, shutting down
  | AH00015: Unable to open logs

Maybe I missed something in the configuration.

Using custom settings leads to a PMA fatal error

Hello there !

Thank you for your container, it has been very useful to me for quite a moment now !

But now my team seeks comfort, and asks me little things, like removing the table list pagination !

I tried it following the documentation, using the environment variable JSON_CONFIG in my docker-compose.yml file, but it seems to bring chaos to PMA. I get the following error :

Fatal error: Call to a member function getName() on null in /var/www/html/libraries/ThemeManager.php on line 507

I am using the latest version of the container, and my docker-compose looks like this :

mysql:
    container_name: my_mysql
    build: mysql
    environment:
        - MYSQL_DATABASES=database_1,database_2
        - MYSQL_ROOT_PASSWORD=vagrant
        - MYSQL_HOST=localhost
        - MYSQL_PORT=33306
        - MYSQL_USER=me
        - MYSQL_PASSWORD=incredible_pwd
    ports:
        # MySQL
        - "33306:3306"
    volumes:
        # Mysql
        - "./volumes/mysql:/var/lib/mysql"

phpmyadmin:
    container_name: my_phpmyadmin
    image: nazarpc/phpmyadmin
    ports:
        # PHPMyAdmin HTTP
        - "8082:80"
    links:
        - mysql:mysql
    environment:
        - SESSION_TIMEOUT=86400
        - JSON_CONFIG="{'MaxTableList':450}"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.