Search code examples
phpapachedocker

docker image for php is not working on browser for windows 10


I just started to learn docker and tried to create a php image with apache using docker file. As per my understanding I am able to create image using the docker file and after building image I tried to run that image in the form of container and it looks fine to me but when I tried to run that on the browser using "172.17.0.2" IP address its showing The connection was reset issue and i tried a lot but not able to resolve this issue. I am attaching few images for to clearly mention my issue.

Dockerfile:

FROM php:7.2-apache
COPY src/ /var/www/html/

and the screen of windows pwershell showing

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message [Sat Oct 13 17:42:22.816118 2018] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.10 configured -- resuming normal operations [Sat Oct 13 17:42:22.817371 2018] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

Any help would be appreciated, thanks.


Solution

  • I am able to resolve the issue now, there were two problems: (1) I was trying to reach an incorrect IP the correct was 127.0.0.1 (2) I wasn't running windows power shell as admin to run docker commands.

    One more thing if anyone still faces the same issue then please make sure you configured to access shared drive for docker containers through docker interface.