-1

I have simple example in local machine:

docker service create --name nginx --publish 8080:80 --replicas 2 nginx:stable-alpine

And if i do

curl http://localhost:8080

I get standart nginx page and it is ok

But when in chrome i type http://localhsot:8080 I take endless loading without answer. Can somebody explain why it's happening?

Billizzard
  • 472
  • 6
  • 15

1 Answers1

0

docker service create --name nginx --publish 8080:80 --replicas 2 nginx:stable-alpine

It Is Working Fine for me with curl as well as browser make sure you join as a swarm manager node

swetank soni
  • 29
  • 1
  • 13
  • Is it required join another manager node? I thought when i do 'docker swarm init' I already have manager in local machine. – Billizzard Oct 27 '20 at 12:58
  • this command "docker service create --name nginx --publish 8080:80 --replicas 2 nginx:stable-alpine" works for me , i am using docker-machine on mac , provide me your system info and error log if your are facing some ? – swetank soni Oct 28 '20 at 11:48
  • I notice, if I type http://127.0.0.1:8080 site is opened – Billizzard Oct 29 '20 at 14:49
  • @Billizzard your localhost is misconfigured. check etc/hosts file. it should be configure like this --> 127.0.0.1 localhost – swetank soni Oct 30 '20 at 06:33