Docker Container for phpMyAdmin

Been containerizing a lot of my tools and just added phpMyAdmin to that list.

It’s very easy to get going with it esp. if you also happen to have a Docker container running MySQL albeit with one minor issue.

Official docker hub page: https://hub.docker.com/r/phpmyadmin/phpmyadmin/

Use an example Docker Run script below

docker run \
--name name \
--restart=always \
-d \
--link mysqlcontainer:mysql \
-p localport:80 \
-e "PMA_HOST=mysqlcontainer" \
phpmyadmin/phpmyadmin
  • localport is the port you want phpMyAdmin to use. Generally it’s port 80 but I like to override that with a different port#
  • mysqlcontainer is the name of the running MySQL container
  • The “-e” option with “PMA_HOST” must be provided (atleast for now) with value equal to the name of the running MySQL container. Note that the official docs do not indicate that but without this I was receiving following error while trying to log in. So PMA_HOST is a workaround

#2002 – php_network_getaddresses: getaddrinfo failed: Name does not resolve — The server is not responding (or the local server’s socket is not

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.