Deploying Docker Container of .NET Application through AWS App2Container

I have a .NET 4.8 application that runs successfully on an AWS EC2 instance. It uses IIS and the application is accessible via a website. It connects to a SQL Server Express database running on AWS RDS to retrieve credentials for users to login.

I am using AWS App2Container to containerize this application. From the Docker image it creates, I am able to access the website locally (on the EC2 instance that I am testing on). However, my container is not able to access the RDS. In general, my container is not able to access any websites. This was confirmed through performing a ping on different websites. This is the response I am getting:

ping google.com
Ping request could not find host google.com. Please check the name and try again.

This led me to believe that there are issues with the DNS of the Docker container. However, I added the same DNS server that my EC2 instance uses, but this issue persists.

I am not sure why I cannot connect to my RDS database.

Have you managed to solve it since then?Since it only happened on EC2, it could be something EC2 specific. This is probably why you didn’t have replies. But if you just created a virtual machine, it would be better if you could tell more about that virtual machine.

We usually need the following information to understand the issue:

  1. What platform are you using? Windows, Linux or macOS? Which version of the operating systems? In case of Linux, which distribution?

  2. How did you install Docker? Sharing the platform almost answers it, but only almost. Direct links to the followed guide can be useful.

  3. On debian based Linux, the following commands can give us some idea and recognize incorrectly installed Docker:

    docker info
    docker version
    

    Review the output before sharing and remove confidential data if any appears (public IP for example)

    dpkg -l 'docker*' | grep '^ii'
    snap list docker
    

    When you share the outputs, always format your posts according to the following guide: How to format your forum posts

Isn’t .NET 4.8 Windows only. So at the end A2C should create a Windows container and deploys it to ECS or EKS. In case of EKS there is no docker involved at all. In both cases the OS will be something like Windows Server 2019 or newer. On Windows Server, the Moby project provides the docker installation.

I have some questions regarding the RDS communication:

  • are you using iam auth, or classic credentials?
    • Is iam auth even a thing with Windows Container? If it is: did you configure an instance profile that grants the required permissions?
  • If it’s credential auth: how do you provide the credentials?
  • Does the SecurityGroup of the container allow outgoing traffic to the RDS database?
  • Does the SecruiyGroup ithe RDS database allow incoming traffic from the container?