AWS Docker deployment not exposing port to outside world with Dockerrun file

问题: I'm deploying a spring-boot application to AWS using a docker image, i need to be able to connect remotely to the application with hawtio console to monitor behavior. I hav...

问题:

I'm deploying a spring-boot application to AWS using a docker image, i need to be able to connect remotely to the application with hawtio console to monitor behavior. I have a Dockerfile created and an Dockerrun.aws.json file, for example, the dockerfile has EXPOSE 8080, and the Dockerrun is:

{
"AWSEBDockerrunVersion": "1",
"Ports": [
  {
    "ContainerPort": 8080,
    "HostPort": 5000
  }
]
}

The AWS EB instance has the port 5000 opened (I tested it), but the Hawtio console does not connect to the application. Can someone point me in the right direction about how to properly expose the port?


回答1:

If you are using EB, then how are you specifying which docker image to use?

This information needs to be specified inside of the Dockerrun.aws.json file, which is missing in the example that you have provided.

{
    "AWSEBDockerrunVersion": "1",
    "Image": {
        "Name": "path to the image's repository",
        "Update": "true"
    },
    "Ports": [
        {
            "ContainerPort": 8080,
            "HostPort": 5000
        }
    ]
}
  • 发表于 2019-01-20 23:32
  • 阅读 ( 187 )
  • 分类:网络文章

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除