Skip to content

Container Failure - Docker

0

We are unable to containerize our project in EC2 instance, and we receive an Exceed error in the logs. Also it has problem connecting to the network for some reason(it is not connecting to internet, although we have a gateway and attached to vpc)

asked 2 years ago136 views

1 Answer
0

The issues you're experiencing with containerizing your project in EC2 and the network connectivity problems could be related to several factors:

  1. Exceed error: This might be due to reaching Amazon ECS service quotas. ECS has limits on the maximum resources you can use in each AWS Region for your account. To resolve this:

    • Delete outdated versions of task definitions
    • Remove unused ECS services with no active tasks
    • Delete any unused EC2 Auto Scaling group capacity providers
    • Consider requesting a quota increase if needed after optimizing resources
  2. Network connectivity issues: Several things could cause this:

    • Check your VPC configuration to ensure the EC2 instance has a proper route to the internet via an Internet Gateway or NAT Gateway
    • Verify DNS resolution is working correctly within your VPC
    • Examine the security group settings to confirm they allow necessary outbound traffic
    • If using a proxy, ensure it's correctly configured for the Docker daemon and containers
  3. Docker-specific issues:

    • Ensure the Docker daemon has sufficient storage space. By default, ECS-optimized AMIs have separate volumes for the OS and Docker storage. If the Docker storage is full, you may need to add more storage or clean up unused images and containers
    • Check Docker logs for any specific error messages
    • Verify the network mode of your Docker containers
  4. EC2 instance configuration:

    • If using IMDSv2, ensure the hop limit is set to 2 for container environments
    • Check the IAM role attached to the EC2 instance has the necessary permissions

To troubleshoot further:

  • Review EC2 and Docker logs for specific error messages
  • Use commands like 'docker ps' and 'docker network ls' to inspect container and network status
  • Try running a simple curl command to an external site from within the EC2 instance to test basic internet connectivity

If issues persist after these checks, you may need to review your overall network architecture and Docker configuration in more detail.
Sources
Resolve Amazon ECS service quota issues | AWS re:Post
Docker container running in EC2 is unable to create Cloudwatch log stream. | AWS re:Post
Troubleshoot the Docker API error (500): devmapper in Amazon ECS - Amazon Elastic Container Service

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.