Kingamere
Kingamere

Reputation: 10146

How to connect to a docker container from the outside world

I have a web application that is running inside docker container which is running on an Amazon Linux ec2 instance. I would like to connect to that container from the outside world.

How would I do this? I tried using the ec2 instance's ip address and the port that is exposed, such as: 34.21.331.333:7070

but this would just give me a 404 error.

I also tried exposing the IP of the ec2 instance at run time, such as: docker run --name myapplication -p 34.21.331.333:7070:7070

But docker gave me the error: bind: cannot assign requested address

Any ideas?

Thanks

EDIT 1:

I am able to connect now, resolved.

Upvotes: 0

Views: 280

Answers (1)

Paul Becotte
Paul Becotte

Reputation: 9997

In EC2, you have to check the security group for your instance and ensure that the port you want is opened to the world.

Upvotes: 1

Related Questions