域在主机上parsing,但不在docker容器内
我有两个容器,一个运行启动量angular器的Node.js进程,另一个运行独立的Selenium容器。 该文件如下所示:
version: '2' services: www.example.localhost: build: . depends_on: - selenium dns_search: - static.example.localhost extra_hosts: - "static.example.localhost:127.0.0.1" ports: - "3000:3000" - "4000:4000" volumes: - ./src:/code/src - ./api:/code/api entrypoint: "npm run" command: "test:e2e" selenium: dns_search: - selenium.example.localhost image: selenium/standalone-chrome-debug:2.52.0 environment: no_proxy: localhost volumes: - /dev/urandom:/dev/random ports: - "4444:4444" - "6900:5900"
www.example.localhost
运行量angular器,然后通过protractor.config.js中的这些行连接到selenium容器:
seleniumAddress: "http://selenium:4444/wd/hub", directConnect: false,
当我在Selenium容器上运行VNC时,打开容器中的chrome浏览器并键入www.example.localhost:3000
它无法parsing域。 但是,当我运行wget www.example.localhost:3000
它得到的index.html文件就好了。 任何想法我做错了什么?
在Chrome浏览器中,无论您使用哪种DNS设置,任何以localhost
结尾的域都会parsing为127.0.0.1。 将域从.localhost
更改为.dev
修复它。
- 捆绑问题(angular2 + webpack捆绑)
- 在Angular 2 Firebase App中的net :: ERR_CONNECTION_CLOSED
- 模块构build失败:错误:AotPlugin被检测到,但是它是一个错误类的实例
- 如何运行browser-perf的Node APItesting
- Angular Universal + External API
- 当npm启动我的Angular2项目时,重复的标识符导出错误
- 堆栈“错误:证书链中的自签名证书”当试图build立“节点gypconfiguration”
- 组件文件夹中的index.js的好处
- 如何在Angular 2中进行正确的http post调用?