Skip to content

Parse Compose service network object form for aliases #116

Description

@thromel

Summary

container-compose fails to decode the Compose object form for service networks, which is required for aliases and per-network service options.

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:
        aliases:
          - web-alias

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

networks:
  appnet:

Run:

container-compose --file compose.yml up -d

Actual behavior

Error: DecodingError.typeMismatch: expected value of type Sequence. Path: services.web.networks. Debug description: Expected to decode Sequence but found Node instead.

Expected behavior

Compose supports both forms:

networks:
  - appnet

and:

networks:
  appnet:
    aliases:
      - web-alias

container-compose should parse the object form and either:

  • apply supported per-network service settings, or
  • produce a targeted unsupported-field warning while continuing for settings it can support.

Aliases may depend on the broader service-discovery/DNS work, but the YAML decoder should accept the Compose object shape.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions