Services on the same Compose network cannot resolve service names

Đang mở
#114 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
swift
Lĩnh vực
networking

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Swift
Star
1k
Fork
61
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
17

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Mcrich23/Container-Compose

Tất cả issue của Mcrich23/Container-Compose

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.