简体   繁体   中英

Obtaining mapped port from within docker container

I'm using Cloudfront and ECS to run tasks within AWS. I map my tasks to random host ports using the following command:

      PortMappings:
        - HostPort: 0
          ContainerPort: 8080

I need to know, within the container, the DN of the host and the random port the task was mapped to. How can I achieve this?

According to the documentation ,

After a task reaches the RUNNING status, manual and automatic host and container port assignments are visible in the Network Bindings section of a container description of a selected task in the Amazon ECS console, or the networkBindings section [of] DescribeTasks responses.

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