Docker example for Mac nginx not starting

Mac 10.11.5 is here. I'm specifically trying to install Docker for Mac (not the Docker Toolbox or any other suggestion). I followed all the instructions on the installation page and everything went fine until they asked you to start the nginx server (Step 3. Examine the sample applications and start).

The work docker run hello-worldworked perfectly without any problems. I was able to see the correct console output that was expected for this image.

However , they will then ask you to start the nginx instance:

docker run -d -p 80:80 --name webserver nginx

I ran this and did not get any errors. Expected console output:

Unable to find image 'nginx:latest' locally latest: Pulling from library/nginx
51f5c6a04d83: Pull complete 
a3ed95caeb02: Pull complete 
51d229e136d0: Pull complete 
bcd41daec8cc: Pull complete 
Digest: sha256:0fe6413f3e30fcc5920bc8fa769280975b10b1c26721de956e1428b9e2f29d04
Status: Downloaded newer image for nginx:latest
ae8ee4595f47e7057e527342783d035b224afd17327b057331529e2820fe2b61

So I ran docker ps:

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                         NAMES
ae8ee4595f47        nginx               "nginx -g 'daemon off"   12 seconds ago      Up 10 seconds       0.0.0.0:80->80/tcp, 443/tcp   webserver

. http://localhost, ( Chrome):

enter image description here

, ? 5 , nginx/docker , .


GitHub:

https://github.com/docker/for-mac/issues/393

+4
3

​​

80 httpd https://github.com/nginxinc/docker-nginx/blob/11fc019b2be3ad51ba5d097b1857a099c4056213/mainline/jessie/Dockerfile#L25

-p 80:80 :

docker run -p 80:80 nginx
172.17.0.1 - - [22/Aug/2016:17:26:32 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36" "-"

, , httpd , ( ), , , localhost - 127.0.0.1? ipv6, docker-compose.yml

version: '2'
services:
  webserver:
    image: nginx
    ports:
      - '80:80'

docker-compose up - , tomcat, puma server FPM , , .

+4

Try curl -XGET `docker-machine ip`:80

+1

Chrome, Safari.

, , , . , , - .

-1

Source: https://habr.com/ru/post/1652079/


All Articles