DEV Community

Maureen Chebet
Maureen Chebet

Posted on

Docker best practices

Hello community,

I am currently deploying docker images in ECS cluster with Fargate compute engine. I want to know why I can't access it from the browser using the public IP. What could I have missed in the configuration? Can I run a multi-container in ECS without an integration with AWS Elastic Beanstalk?

P.S am using published images from docker hub

Thanks in advance.

Top comments (9)

Collapse
 
vepo profile image
Victor Osório •

I do not know how Fargate works, but for docker containers (running local or in a Kubernetes cluster) you need to expose the port you want to access.

Collapse
 
bianca profile image
Maureen Chebet •

Let me try exposing the port. Thanks

Collapse
 
bianca profile image
Maureen Chebet •

I did that and got it working 🙌 thanks thanks

Collapse
 
vepo profile image
Victor Osório •

😀😀😀😀😀

Collapse
 
ryands17 profile image
Ryan Dsouza •

Could you try by exposing the Port that you want to access and also keeping that port open in your Security Group's inbound rules?

Collapse
 
bianca profile image
Maureen Chebet •

Still not working 🤦🏽‍♀️

Collapse
 
ryands17 profile image
Ryan Dsouza •

Would it be possible for you to show the process that you are doing currently in a remote session so that we could go through the steps of the creation of the cluster? Because I tried running an apache image with Fargate and it works.

Before that, you could try a couple of things.

  1. Checking if the entire image runs locally without any errors.
  2. The subnet you're deploying to is a public subnet.
Thread Thread
 
bianca profile image
Maureen Chebet •

I got it working. Thank you so much. The issue was subnets and the port. 🙌🙌🙌

Thread Thread
 
ryands17 profile image
Ryan Dsouza •

Awesome!!! Glad to be of help.