Bamboo-Docker镜像运行错误-连接被拒绝

时间:2019-08-28 21:29:41

标签: python docker flask connection bamboo

我正在使用Bamboo运行python应用程序(Flask应用程序)。 并成功地从存储库中签出源代码,并使用Bamboo本身创建docker镜像。 并尝试使用Bamboo docker任务运行图像,错误低于Connection refused。 我该如何解决这个问题。

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文件:

FROM python
COPY . /app
WORKDIR /app
RUN pip install -r python_modules.txt
ENTRYPOINT ["python"]
CMD ["app.py"]

1 个答案:

答案 0 :(得分:1)

在没有看到docker文件的情况下,好像端口未打开。

  • 您需要通过dockerfile显式公开端口
  • 您也可以更改入口点。
  • 您需要在dockerfile中添加以下内容
ENTRYPOINT python app.py
EXPOSE 5000