我正在使用Windows 10,以powershell作为命令行。
我正在遵循一个简单的tutorial,但不幸的是,我正在使用代码Exit 127
和The system cannot find the path specified.
运行命令后:
docker-compose ps
The system cannot find the path specified.
Name Command State Ports
--------------------------------------------------------------------------------------------------------------------------------------------
httproute-simple-match_front-envoy_1 /docker-entrypoint.sh /bin ... Up 10000/tcp, 0.0.0.0:8000->80/tcp, 0.0.0.0:8001->8001/tcp
httproute-simple-match_service_blue_1 /bin/sh -c /usr/local/bin/ ... Exit 127
httproute-simple-match_service_green_1 /bin/sh -c /usr/local/bin/ ... Exit 127
httproute-simple-match_service_red_1 /bin/sh -c /usr/local/bin/ ... Exit 127
其他docker命令,例如
docker-compose ps --service
给出:
前使节 service_blue service_green service_red`
有效。
我真的很困惑如何解决它,我看过很多文章,但是没有一篇与之相关。
答案 0 :(得分:1)
接下来,您需要做的第一件事是检查出口容器的日志以查找发生了什么情况。
docker-compose ps
The system cannot find the path specified.
Name Command State Ports
--------------------------------------------------------------------------------------------------------------------------------------------
httproute-simple-match_front-envoy_1 /docker-entrypoint.sh /bin ... Up 10000/tcp, 0.0.0.0:8000->80/tcp, 0.0.0.0:8001->8001/tcp
httproute-simple-match_service_blue_1 /bin/sh -c /usr/local/bin/ ... Exit 127
httproute-simple-match_service_green_1 /bin/sh -c /usr/local/bin/ ... Exit 127
httproute-simple-match_service_red_1 /bin/sh -c /usr/local/bin/ ... Exit 127
然后,如果您像下面那样检查出口容器的日志,则会发现错误:
C:\test\envoy-proxy-demos\httproute-simple-match>docker logs httproute-simple-match_service_red_1
/bin/sh: /usr/local/bin/start_service.sh: not found
看到此消息时,很可能是因为Windows上的文件格式与linux不兼容。对于您的情况,要使所有东西正常工作,您需要执行下一步:
在git克隆源代码之后,修改envoy-proxy-demos/apps/service.py
,并将#!/usr/bin/python3
添加到此文件的开头。
在git-bash的帮助下,进入envoy-proxy-demos/apps
,然后将以下文件格式从dos更改为unix:
$ dos2unix start_service.sh service.py
dos2unix: converting file start_service.sh to Unix format...
dos2unix: converting file service.py to Unix format...
最后,构建并开始:
docker-compose up --build -d
注意:如果您过去已经执行过上述命令,则您仍可以使用build的缓存,因此您的更改可能不会生效,如果这是您的事,请改为执行下一步:
docker-compose build --no-cache
docker-compose up --build -d
然后,您可以在完成上述命令后看到所有容器:
Name Command State Ports
-----------------------------------------------------------------------------------------------------------------------------------------
httproute-simple-match_front-envoy_1 /docker-entrypoint.sh /bin ... Up 10000/tcp, 0.0.0.0:8000->80/tcp, 0.0.0.0:8001->8001/tcp
httproute-simple-match_service_blue_1 /bin/sh -c /usr/local/bin/ ... Up 10000/tcp, 80/tcp
httproute-simple-match_service_green_1 /bin/sh -c /usr/local/bin/ ... Up 10000/tcp, 80/tcp
httproute-simple-match_service_red_1 /bin/sh -c /usr/local/bin/ ... Up 10000/tcp, 80/tcp
答案 1 :(得分:0)
通常,如果您没有为Docker VM分配足够的RAM,则会在Mac版Docker或Windows版Docker上发生这种情况
检查首选项->高级并尝试添加更多RAM。