python - Bamboo - Docker image run Error - Connection refused
问题描述
I am using bamboo to run the python application(Flask app).
And successfully check out the source code from repository and created docker image using bamboo itself.
And tried to run the image using bamboo docker task got below Connection refused
error.
How do I solve this issue.
Failed connecting to http://localhost:5000, error: Connection refused (Connection refused)
Attempting connection to http://localhost:5000
Failed connecting to http://localhost:5000, error: Connection refused (Connection refused)
Attempting connection to http://localhost:5000
Failed connecting to http://localhost:5000, error: Connection refused (Connection refused)
Attempting connection to http://localhost:5000
Failed connecting to http://localhost:5000, error: Connection refused (Connection refused)
Attempting connection to http://localhost:5000
Failed connecting to http://localhost:5000, error: Connection refused (Connection refused)
Docker file:
FROM python
COPY . /app
WORKDIR /app
RUN pip install -r python_modules.txt
ENTRYPOINT ["python"]
CMD ["app.py"]
解决方案
没有看到 docker 文件,这看起来好像端口没有打开。
- 您需要通过 dockerfile 显式公开端口
- 您也可以更改入口点。
- 您需要在 dockerfile 中有以下内容
ENTRYPOINT python app.py
EXPOSE 5000
推荐阅读
- roomle - Rails 6 中的 Roomle SDK,使用 webpacker,抛出错误
- css - 如何通过包含字体路径的 source() 在模板中加载 CSS 文件
- javascript - Dynamodb:使用地图索引更新地图数组
- c++ - C++ SFML tile map最后一行错误大小问题
- javascript - 循环LI时Jquery替换
- git - Azure DevOps:如何使用 REST API 存储库在 GIT 存储库中创建文件夹
- python - 如何计算可能包含列表和字符串的变量中的字符
- swift - 有没有办法在不删除视图并重新添加的情况下更新 StackView 中的视图?
- ruby-on-rails - Pundit::AuthorizationNotPerformedError
- spotfire - 如何从存在多个满足条件的整体之间的字符串中提取文本并返回所有值