2

I have a docker image which runs with this command

docker run -it -p 8118:8118 -p 9050:9050 -d dperson/torproxy

It requires a port as an argument.

What I tried?

I pushed this image to ECR repo, created task related to this image. After I created service with network-load-balancer. But the server is not responding when I try to GET DNS name of network-load-balancer.

I think this is because I didn't configure the port for the container. How can I do this?

Gufran Hasan
  • 8,910
  • 7
  • 38
  • 51
Vitali Skripka
  • 562
  • 1
  • 7
  • 25

1 Answers1

0

Port Mappings are part of the Task Definition > Container Definitions.

This can be done through the UI Add Container or using the CLI / SDK RegisterTaskDefinition

{
   "containerDefinitions": [ 
      { 
         ...
         "portMappings": [ 
            { 
               "containerPort": number,
               "hostPort": number,
               "protocol": "string"
            }
         ],
         ...
      }
   ]      
}
Matt D
  • 3,289
  • 1
  • 15
  • 29