arbitrage
(Arbitrage)
February 24, 2017, 9:39am
1
Hi,
I am trying to access service from Ajax requests like this http://gateway:4000/auth
And my docker-compose file looks as below
version: '2’
services:
UI:
image: arbitrage/ui
restart: always
ports:
- 8182:8182
registry:
image: arbitrage/registry
restart: always
ports:
- 8761:8761
logging:
options:
max-size: "10m"
max-file: “10”
gateway:
image: arbitrage/gateway
restart: always
links:
- registry
ports:
- 4000:4000
logging:
options:
max-size: "10m"
max-file: “10”
I am getting the error
OPTIONS http://gateway:4000/auth net::ERR_NAME_NOT_RESOLVED
What am I missing. Can some one please help
think
(Think)
February 24, 2017, 11:34am
2
gateway is a name that just resolves within your docker network.
You bind your gateway:4000 to your localhost:4000.
So access it with http://localhost:4000/ should work for you
arbitrage
(Arbitrage)
February 24, 2017, 3:25pm
3
Hi,
Thanks for response. It is not accessible with http://localhost:4000 . I had tried this earlier only.
But if I hard code container ip then it becomes accessible. But I don’t want to hard code IP address.
think
(Think)
February 24, 2017, 3:37pm
4
hard to guess where the problem lies without detailed information about your environment.
I guess you do not have a native docker installation, but are using boot2docker.
arbitrage
(Arbitrage)
February 24, 2017, 3:46pm
5
Hi,
I have installed docker with Docker ToolBox and my docker ps give this result
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d2d0eb9471d7 arbitrage/build “java -Xmx200m -jar /” 4 hours ago Up 4 hours 0.0.0.0:6000->6000/tcp services_build_1
c6c2039eb3af arbitrage/ui “npm start” 4 hours ago Up 4 hours 0.0.0.0:8182->8182/tcp services_UI_1
95bd52fec454 arbitrage/gateway “java -Xmx200m -jar /” 4 hours ago Up 4 hours 0.0.0.0:4000->4000/tcp services_gateway_1
807c1defa608 arbitrage/registry “java -Xmx200m -jar /” 2 days ago Up 5 hours 0.0.0.0:8761->8761/tcp 807c1defa608_services_registry_1
arbitrage
(Arbitrage)
February 24, 2017, 4:02pm
6
arbitrage
(Arbitrage)
February 24, 2017, 4:03pm
7
If we want to access UI on my docker instance from others browser , it does not work.