Feature Request: allow config-from in docker-compose files for swarm stacks
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
Goals
- allow networks created with
--config-fromto not be considered "dangling" when runningdocker system prune - associate
--config-fromnetworks to the service stack they are used in
Description
Currently, when I create a local bridge network on each of my swarm nodes using --config-only, those networks are not removed with docker system prune. However, when I create the actual swarm network with --config-from, that network is removed with docker system prune. Having the ability to define a config-from network in the swarm compose file that is related to the service stack would be helpful, and I would assume would also prevent it being considered a dangling network.
From what I have found, there is no configuration option for --config-from in docker-compose files. It would be nice to have a flag under .network.<network-name>.ipam.config, such as .network.<network-name>.ipam.config.config-from:
[...]
networks:
my-network:
ipam:
config:
- config-from: my-local-node-network
Related: https://github.com/docker/cli/pull/49, https://github.com/docker/cli/issues/605, https://github.com/docker/cli/issues/407
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the related docker/cli pull request and issues listed in the report, then trace how docker-compose network IPAM configuration and --config-from networks are handled. Done means a swarm compose file can define config-from for a network, the network is associated with its service stack, and docker system prune no longer treats it as dangling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, go
- Domain
- cli, devops, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100