Use Docker to deploy phpmyadmin

Docker is a very powerful tool to deploy application, no need to worry about the Operation System, docker app delivered with runtime, it means you don’t need prepare the runtime and dependencies and just load the docker images and run it as a container:

First, let’s search the phpmyadmin image from dockerhub,just run the following command:

docker search phpmyadmin
(base) root@iZj6chew62f61q6kwc6ogsZ:/home/wwwroot/tech.ipv6center.org/wp-includes/js# docker search phpmyadmin
NAME                              DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
phpmyadmin/phpmyadmin             A web interface for MySQL and MariaDB.          1106                                    [OK]
phpmyadmin                        phpMyAdmin - A web interface for MySQL and M…   136                 [OK]                
nazarpc/phpmyadmin                phpMyAdmin as Docker container, based on off…   61                                      [OK]
bitnami/phpmyadmin                Bitnami Docker Image for phpMyAdmin             22                                      [OK]

Then ,chose the first image and run the following command:

docker run --name phpmyadmin4 -d -e PMA_HOST=rm-desh38b2h3b7vo.mysql.rds.aliyuncs.com -p 13306:80 phpmyadmin/phpmyadmin
The paramters:
-e PMA_HOST specify the host you want to connect, here is the aliyun RDS mysql server
-p Port mapping, map the host 13306 to the container phpmyadmin4’s 80 port, you can just http://host:133306 got the phpmyadmin login page
 

Conclusion

Docker is easy to use, you just need run a command and we got the phpmyadmin for mysql.

0 0 vote
Article Rating
This entry was posted in Docker and tagged , . Bookmark the permalink.
Subscribe
Notify of
guest
0 评论
Inline Feedbacks
View all comments