Jump to content

php_network_getaddresses: getaddrinfo failed error in Docker's adminer


mstdmstdd

Recommended Posts

Hello!

I have problem with access to adminer in my docker container with laravel 5/mysql app. I got error :

Quote

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed


In my docker-compose.yml :

version: '3'

services:

    votes_app:
        build:
            context: ./web
            dockerfile: Dockerfile.yml
        
        container_name: votes_app_container
        environment:
            - APACHE_RUN_USER=#1000
        volumes:
            - ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
        ports:
            - 8081:80
        working_dir: ${APP_PTH_CONTAINER}


    db:
        image: mysql:5.6.41
        restart: always
        environment: 
            MYSQL_ROOT_PASSWORD: 1
        volumes:
            - ${DB_PATH_HOST}:/var/lib/mysql


    adminer:
        image: adminer
        restart: always
        ports:
            - 8082:8080
        links:
            - db


    votes_composer:
        image: composer:1.6
        container_name: votes_composer_container
        volumes:
            - ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
        working_dir: ${APP_PTH_CONTAINER}
        command: composer install --ignore-platform-reqs


I rebuilded the app but I failed to login into adminer : https://imgur.com/a/JWVGfBA

I run in console of my OS pointing to other unused 8089 port:

$ docker run -p 8089:8080 -e ADMINER_DEFAULT_SERVER=db adminer
PHP 7.2.11 Development Server started at Thu Nov  1 07:00:46 2018
[Thu Nov  1 07:01:11 2018] ::ffff:172.17.0.1:34048 [200]: /
[Thu Nov  1 07:01:20 2018] ::ffff:172.17.0.1:34052 [302]: /
[Thu Nov  1 07:01:21 2018] ::ffff:172.17.0.1:34060 [403]: /?server=db&username=root

But again error logining to adminer to 8089 port, but the error message was different :

https://imgur.com/a/a8qM4bt

What is wrong ? 

Thanks!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.