I'm learning docker for my first project using Slim framework (PHP). I created a dockerfile to build an image with all the source code in it. When I run the image with the run command it shows me
<b>Warning</b>: Unknown: php_network_getaddresses: getaddrinfo failed: Name does not resolve in <b>Unknown</b> on line <b>0</b><br />
[Sat Jun 15 09:41:14 2019] Failed to listen on 127.0.0.1:8080 (reason: php_network_getaddresses: getaddrinfo failed: Name does not resolve)
Dockerfile looks like:
FROM php:7-alpine
COPY . /var/www
WORKDIR /var/www
CMD [ "php", "-S 127.0.0.1:8080 -t public" ]
Docker run command is:
sudo docker run -it --rm --network="host" --expose 8080 --name cm2 collection_manager_1
Don't know how I can fix this. Can someone help me?