R
R
Rustam Samandarov2017-11-05 09:28:38
Docker
Rustam Samandarov, 2017-11-05 09:28:38

How can I get through http to phpmyadmin of a docker container?

Hello, in general, the problem is this:
There is a Virtualbox machine (Debian + docker) that has a network card connected via NAT. Guest OS
IP address 10.0.2.15 eth0 interface
IP address 10.0.2.15 docker0 interface IP address 172.17.0.1 Bridge
IP address br-35f4538777fe (arbitrary) 172.72.20.1
phpmyadmin IP address (docker container name phpmyadmin) 172.72.20.5
apache2 IP address (docker container name apache2) 172.72.20.2
apache2 container became available via http after settings in docker-compose.yml
added the following
ports item:
- "80:80"
------------------ ------------------------------
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
links:
- mysql:mysql
environment:
PMA_HOST: mysql
volumes:
- ./docker/config/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php
networks:
self:
ipv4_address: 172.72.20.5
B guest OS (Debian) through port 80 at 172.72.20.5 everything works.
You need to bring 172.72.20.5 outside to the host machine so that you can work with it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rustam Samandarov, 2017-11-07
@yii2dev

In general, I changed the config in docker-compose.yml
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
links:
- mysql:mysql
environment:
PMA_HOST: mysql
volumes:
- ./docker/config/phpmyadmin/config.user.inc.php:/etc /phpmyadmin/config.user.inc.php
networks:
self:
ipv4_address: 172.72.20.5
ports:
- "8080:80" # added this item
------------------- ----------------------------------------
Then I did port forwarding in VirtualBox in the network settings guest machine (NAT)
And everything worked.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question