Unable to run Adminer on Browser on given port in a docker container

301 views Asked by At

I have tried creating a Docker container for Adminer using this command: sudo docker run -it -d --name admine -p 7000:7000 --network techBankNet -e ADMINER_DEFAULT_SERVER=mysql_container --restart always adminer:latest.

After I run the command sudo docker ps, it gives me the following output.

CONTAINER ID   IMAGE               COMMAND                  CREATED        STATUS                         PORTS                                                                     NAMES
d170a4d96c10   adminer:latest      "entrypoint.sh php -…"   8 hours ago    Up 47 minutes                  0.0.0.0:7000->7000/tcp, :::7000->7000/tcp, 8080/tcp                       admine
6f980494ad04   mysql:latest        "docker-entrypoint.s…"   9 hours ago    Up 47 minutes                  3306/tcp, 33060/tcp, 0.0.0.0:3307->3307/tcp, :::3307->3307/tcp            mysql-container

To note, I can also run MySQL from the docker container using this command: sudo docker exec -it mysql-container mysql -p. From the given output, it is evident that it is working perfectly on the docker container.

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.33 MySQL Community Server - GPL

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

In the command to create the container for the adminer, I have specified that port 7000 on the container will connect to port 7000 of the host. Therefore, if I hit localhost:7000, it should show me the UI of adminer.

However, when I do that in the browser, it shows this message: "Problem loading page." Even if I try to connect with it using the curl command, it gives me this error: No route to host:

curl -i my_ip_address:7000
curl: (7) Failed to connect to my_ip_address port 7000 after 3069 ms: No route to host 

So, my query is, what might be the issue here?

0

There are 0 answers