启用时的 AWS 任务定义警告 "Auto-configure CloudWatch Logs"

AWS Task Definition warning when enabled "Auto-configure CloudWatch Logs"

当我启用 Auto-configure CloudWatch Logs 时出现有关网络模式的警告,它显示 Your containers in the task will share an ENI using a common network stack. Port mappings can only specify container ports (any existing host port specifications will be removed).

这是出现的警告,我不明白那是什么意思

我认为这与日志配置无关。这与您选择的网络选项 (awsvpc) 有更多关系。当你 select 时,你基本上是在 VPC 内登陆你的任务,任务将获得一个 VPC ip 地址。换句话说,没有 docker 主机 natting,您在主机的端口 12345 上公开 nginx 容器的端口 80。该警告只是说您需要确保任务中的所有容器都不会与端口重叠,因为它们可以在分配给任务的 VPC IP 地址上按原样访问。请注意,awsvpc 是 Fargate 上唯一支持的网络模式(因为 Fargate 无论如何都没有主机)。有关 ECS 网络模式的背景,请参阅 here