Swagger UI的Docker容器未加载

时间:2016-08-30 08:36:05

标签: docker swagger swagger-ui docker-machine swagger-editor

运行以下命令会导致127.0.0.1:80127.0.0.1:8080的浏览器出现404错误:

docker pull schickling/swagger-ui
docker run -d -p 127.0.0.1:80:80 -e API_URL=http://localhost:4000/swagger schickling/swagger-ui

docker pull swaggerapi/swagger-editor
docker run -p 127.0.0.1:8080:8080 swaggerapi/swagger-editor

Docker VM for Mac正在运行,我正在探索此错误。其他docker容器也有同样的问题,问题似乎与Swagger UI无关。

使用GUI工具Kitematic时有效,但仅限于以下网址(网址似乎未映射到127.0.0.1):

http://192.168.99.100:32771/
http://192.168.99.100:32770/#/

Docker进程:

$ docker ps
CONTAINER ID        IMAGE                              COMMAND                  CREATED             STATUS              PORTS                     NAMES
60f4058c07ef        swaggerapi/swagger-editor:latest   "http-server --cors -"   2 hours ago         Up 5 seconds        0.0.0.0:32770->8080/tcp   swagger-editor
28179c1eb01c        schickling/swagger-ui:latest       "sh run.sh"              3 hours ago         Up 3 seconds        0.0.0.0:32771->80/tcp     swagger-ui

将端口映射到192.168.99.100是否正常?它不应该是127.0.0.1的形式吗?我正在运行Docker for Mac ...

0 个答案:

没有答案