Code Monkey home page Code Monkey logo

Comments (5)

bor8 avatar bor8 commented on August 22, 2024 13

For the docker-compose aficionados:

version: "3.8"

services:
    adminer:
        command: php -S 0.0.0.0:8080 -t /var/www/html
        depends_on:
            - db
        image: adminer:4.7.7-standalone
        networks:
            blah:
        ports:
            - "8080:8080"
    db:
        image: postgres:12.3
        networks:
            blah:
        volumes:
            - ./db/data/:/var/lib/postgresql/data/:rw

networks:
    blah:

from docker-adminer.

TimWolla avatar TimWolla commented on August 22, 2024 5

PHP's internal webserver requires me to explicitely specify a bind host (i.e. I cannot just provide a port). In #10 I specifically changed the Dockerfile to bind to ::, instead of 0.0.0.0. In the default configuration of net.ipv6.bindv6only = 0 this will bind both IPv4 as well as IPv6.

If you absolutely cannot enable IPv6 on that host you can:

  1. Use the fastcgi version of the image, which should work.
  2. Specify the CMD when running the Docker image: docker run … adminer:standalone php -S 0.0.0.0:8080 -t /var/www/html
  3. Create your own Docker image based on adminer, overriding the CMD:
FROM	adminer:standalone
CMD	[ "php", "-S", "0.0.0.0:8080", "-t", "/var/www/html" ]

from docker-adminer.

klobinoid avatar klobinoid commented on August 22, 2024 3

Hi,

this error occurred to me after updating Docker Desktop for Mac (edge channel) to latest version (2.2.3.0), which has reported problem in IPv6 networking:

Loopback and unspecified IPv6 addresses (:: and ::1) within a container do not currently work. Some web servers and other programs may be using these addresses in their configuration files.

See https://docs.docker.com/docker-for-mac/edge-release-notes/#known-issues.

Solutions suggested by @TimWolla works, but I had problems in other containers as well so I tried downgrading back to 2.2.2.0 which solved networking issues for me as well as this one.

Hope it helps

from docker-adminer.

Jeff-Tian avatar Jeff-Tian commented on August 22, 2024

2. docker run … adminer:standalone php -S 0.0.0.0:8080 -t /var/www/html

@TimWolla does it work with --net=host option?

I tried

both docker run --net=host adminer and docker run --net=host adminer php -S 0.0.0.0:8080 -t /var/www/html.

Both of them will say started successfully but none of them can actually accessible by navigate to http://localhost:8080.

from docker-adminer.

TimWolla avatar TimWolla commented on August 22, 2024

@TimWolla does it work with --net=host option?

It works for me:

[timwolla@~]docker run -it --rm --net=host adminer
[Tue Mar 24 11:38:45 2020] PHP 7.4.2 Development Server (http://[::]:8080) started
[Tue Mar 24 11:38:53 2020] [::ffff:127.0.0.1]:50742 Accepted
[Tue Mar 24 11:38:53 2020] [::ffff:127.0.0.1]:50742 [200]: GET /
[Tue Mar 24 11:38:53 2020] [::ffff:127.0.0.1]:50742 Closing

and

[timwolla@~]curl localhost:8080
<!DOCTYPE html>
<html lang="en" dir="ltr">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex">
<title>Login - Adminer</title>

from docker-adminer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.