Closed mschaefers closed 6 years ago
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:
docker run … adminer:standalone php -S 0.0.0.0:8080 -t /var/www/html
adminer
, overriding the CMD:
FROM adminer:standalone
CMD [ "php", "-S", "0.0.0.0:8080", "-t", "/var/www/html" ]
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
.
@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>
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
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:
when running adminer on a host that has IPv6 disabled, the container fails to start with
Expected: The container must start and listen to IPv4 0.0.0.0:8080