简体   繁体   中英

Assigning IP Address to Docker Container on EC2

I am currently trying to get my docker container to be publicly addressable so I can route it through aws route 53 (DNS). I have my contained on an ubuntu ec2 and am looking for what I should do next. Here is the screenshot of my containers running on the instance.

在此处输入图像描述

Should I try to route these through nginx like normal or can I point them directly to an IP address through something like elastic IP on aws. Thank you!

For static public IP for your instance, elastic ip should be used.

To ensure connectivity to your docker containers, please double check:

  • if security group(s) on the instance allow inbound traffic to the ports of interest.
  • same, please check network ACL on your subnet if they do not block the connections - both inbound and outbound.
  • ensure that the instance is in a public subnet and is reachable from the internet.
  • check if you can connect to the containers from inside of the instance, to make sure that your application is working as expected

Alternatively, if you do not want to manage the instance and docker yourself, you can look into using AWS Fargate or Amazon ECS which will greatly simply management of your containers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM