Bamboo - Docker 图片 运行 错误 - 连接被拒绝

Bamboo - Docker image run Error - Connection refused

我正在使用 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"]

没有看到 docker 文件,这看起来好像端口没有打开。

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