You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the code, this seems to be intentional (I'd have to look into history, but my guess here is that if no explicit subnet is configured for the network, the subnet could change between restarts (?)).
The documentation doesn't show that in the example though, so probably should be fixed
In addition to this, there is a bug: networks created with -subnet do not automatically set the gateway, you need to specify it with -gateway.
However, this document mentions that if -gateway is omitted, the engine will automatically set the gateway.
If you omit the --gateway flag the Engine selects one for you from inside a preferred pool.
The reason for saying "not automatically set" is that you can't see the gateway when you look at the network information with the docker inspect command.
However, if you add the container to the network, you can see the gateway address again by running route -n inside the container, which is .1 of subnet by default, e.g. 172.10.0.1.
Description
I followed the documentation, created the network and set the static ip, but got an error
Reproduce
Expected behavior
No response
docker version
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: