Repository navigation
Add service DNS, host.docker.internal, optional deps, --remove-orphans, up -d - #21
Merged
Merged
Conversation
Apple container 1.3.1 resolves no container names: peers are NXDOMAIN on every network, `--network name,alias=` is rejected, and the opt-in `[dns] domain` registers `<container>.<domain>`, not service names. Nothing resolved `redis` from another service and there was no `host.docker.internal`. ProjectHosts writes one hosts file per service container under ~/.local/state/container-compose/<project>/hosts/ and the translator mounts it over /etc/hosts. It lists project containers on a shared network under service name, container name and aliases, plus host.docker.internal/gateway.docker.internal (the network gateway) and extra_hosts incl. host-gateway. up/start inspect each container after start and rewrite the files of peers sharing a network; down removes them. Rewrites are in place and padded to 4 KiB: the guest bind mount pins the inode and virtiofs caches the size for ~1 s, so a growing rewrite was read truncated. `up -d` is accepted. `up`/`down --remove-orphans` remove containers with the project label whose service label is gone from the file; `up` warns otherwise. depends_on.required comes from ComposeKit 0.0.5; `config` hides optional deps outside the plan. Localhost-bound Mac listeners stay unreachable through the gateway. With `sudo container system dns create host.docker.internal --localhost <ip>` registered, the hosts entry is skipped so container's DNS answers. Closes #16, #17, #18, #19, #20. Claude-Session: https://claude.ai/code/session_011sCioLoXQJi1yNF7q4gYmJ
flaticols
marked this pull request as ready for review
October 15, 2026 12:07
addressBook(for:) seeded only running containers, so `up` never warned about or removed a stopped orphan. down was unaffected. Stopped records carry no addresses, so hosts rendering is unchanged. Claude-Session: https://claude.ai/code/session_011sCioLoXQJi1yNF7q4gYmJ
The tag moved to the squash-merge commit 68bb824 after flaticols/ComposeKit#17 landed; same sources plus the nightly schema sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16, #17, #18, #19, #20.
why
Apple
container1.3.1 resolves no container names at all:getent hosts <peer>is NXDOMAIN on the default and on a custom network,--network name,alias=is rejected, and the only DNS is the opt-in[dns] domainin config.toml, which registers<container>.<domain>, not service names. Soredisnever resolved from another service and there was nohost.docker.internal. Verified on container 1.3.1 / macOS 27.what changed
ProjectHostswrites one hosts file per service container under~/.local/state/container-compose/<project>/hosts/, mounted over/etc/hosts: peers on a shared network by service name, container name andaliases, plushost.docker.internal(the network gateway) andextra_hostsincl.host-gateway.upandstartrefresh the files as containers come up;downremoves them.ContainerRecorddecodes the few fields needed fromcontainer list/inspect.up -dis accepted.up/down --remove-orphansdrop containers whose service label is no longer in the file;upwarns otherwise.depends_on.required: falsecomes from ComposeKit 0.0.5 (flaticols/ComposeKit#17).