Services on the same Compose network cannot resolve service names

未关闭
#114 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
swift
领域
networking

调研方向

Start by reading the Compose network setup and service startup paths in container-compose, then check the linked apple/container issue #856 to learn whether DNS support is available upstream. Reproduce with the supplied two-service Compose file and inspect how services join appnet. Done means service-name lookup works on a shared network, or the upstream limitation and dependency are clearly documented.

由索引模型根据 Issue 内容生成。

描述

Summary

Services started by container-compose cannot resolve each other by Compose service name, even when they are on the same Compose network. IP connectivity works, but DNS lookup for the service name returns NXDOMAIN.

This may depend on an upstream apple/container DNS capability, but it is worth tracking here because it is a core Compose compatibility blocker.

Related upstream issue: https://github.com/apple/container/issues/856

Environment

- OS: macOS 26.5.1 (25F80)
- Xcode: 26.5 (17F42)
- container: 1.0.0 (release, commit ee848e3)
- container-compose: 1.0.0 installed via Homebrew
- Architecture: arm64

Reproduction

compose.yml:

services:
  web:
    image: nginx:alpine
    networks:
      - appnet

  probe:
    image: busybox:latest
    depends_on:
      - web
    networks:
      - appnet
    command: ["sh", "-c", "wget -qO- http://web"]

networks:
  appnet:

Run:

container system start
container-compose --file compose.yml up -d
container logs network-probe

Actual behavior

The probe service exits with:

wget: bad address 'web'

The services are attached to the custom network and IP connectivity works:

container inspect network-web
# network-web has 192.168.65.2/24 on appnet

container run --rm --network appnet busybox:latest wget -qO- http://192.168.65.2
# returns nginx welcome page

But DNS lookup fails:

container run --rm --network appnet busybox:latest nslookup network-web
container run --rm --network appnet busybox:latest nslookup web

Both return NXDOMAIN.

Expected behavior

Services on the same Compose network should be reachable by Compose service name, e.g. http://web, and eventually by configured network aliases.

If this requires upstream support from apple/container, container-compose should ideally document the limitation and track the dependency. If a workaround is possible in container-compose, service-name discovery is the most important Compose compatibility gap to close.

主要语言
Swift
星标
1k
派生
61
平均合并
2 天 4 小时
30 天内合并 PR
17

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Mcrich23/Container-Compose 的其他 Issue

查看 Mcrich23/Container-Compose 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。