GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [docker-29.x backport] Allow configured address with no configured subnet by vvoland · Pull Request #51583 · moby/moby

Conversation

@vvoland

@vvoland vvoland commented Nov 24, 2025

Copy link
Copy Markdown
Contributor
  • backport: Allow configured address with no configured subnet #51577

- What I did

  • fix Can't set static IPs for containers with custom bridge network #51569
  • introduced by Don't copy old network IPAM state to network config on daemon restart #51134
  • depends on test_connect_with_ipv6_address: enable IPv6 docker/docker-py#3372
  • depends on test_create_with_ipv6_address: enable IPv6 docker/docker-py#3373

When a network is configured with no explicit --subnet, daemon.validateEndpointIPAddress tries to prevent a container from being started with a --ip address - with error "user specified IP address is supported only when connecting to networks with user configured subnets".

But the check didn't work in 28.x and older because, until #51134, IPAM config always contained a copy of the network's subnet - whether the user configured it, or it was allocated from the default pools.

So, it was possible to inspect (or guess!) a network's subnet and create a container with a specific address ... restore that behaviour.

- How I did it

  • Use IPAM info instead of config to check whether a configured IP address is in one of a container's subnets.
  • Remove the check that now prevents setting an IP address when the subnet was unspecified at network creation time.

- How to verify it

docker network create n1
docker network inspect n1
docker run --rm -ti --network n1 --ip <address in n1's subnet> alpine

New integration test that fails without the fix.

- Human readable description for the release notes

Allow creation of a container with a specific IP address when its networks were not configured with a specific subnet

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
robmry added 2 commits November 24, 2025 17:33
@robmry @vvoland
Update docker-py in test-docker-py
9cbafea
Pick up fixes for:
- test_create_with_ipv6_address
- test_connect_with_ipv6_address

https://github.com/docker/docker-py/compare/65f7f0c..df3f8e2

Signed-off-by: Rob Murray <[email protected]>
(cherry picked from commit 7e14b4d)
Signed-off-by: Paweł Gronowski <[email protected]>
@robmry @vvoland
Allow configured address with no configured subnet
6280a80
Signed-off-by: Rob Murray <[email protected]>
(cherry picked from commit 84a251d)
Signed-off-by: Paweł Gronowski <[email protected]>
@vvoland vvoland added this to the 29.0.4 milestone Nov 24, 2025
@vvoland vvoland self-assigned this Nov 24, 2025
@vvoland vvoland added status/2-code-review area/networking Networking impact/changelog area/daemon Core Engine kind/bugfix PR's that fix bugs area/networking/ipam Networking labels Nov 24, 2025
robmry
robmry approved these changes Nov 24, 2025
View reviewed changes

@robmry robmry left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thank you!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vvoland
vvoland marked this pull request as ready for review November 24, 2025 16:38
@vvoland
vvoland requested a review from tianon as a code owner November 24, 2025 16:38
@vvoland
vvoland merged commit 4612690 into moby:docker-29.x Nov 24, 2025
@thaJeztah thaJeztah mentioned this pull request Dec 3, 2025
IPv6 subnet can be configured in a network with IPv6 disabled #51653
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@robmry robmry robmry approved these changes
@tianon tianon Awaiting requested review from tianon

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@vvoland vvoland

Labels

area/daemon Core Engine area/networking/ipam Networking area/networking Networking impact/changelog kind/bugfix PR's that fix bugs status/2-code-review

Projects

None yet

Milestone

29.0.4

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@vvoland @robmry
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.