docker / docker/cli

Feature Request: allow config-from in docker-compose files for swarm stacks

Open
#2,851 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/networking impact/compose-file kind/enhancement
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Goals

  • allow networks created with --config-from to not be considered "dangling" when running docker system prune
  • associate --config-from networks 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.