I'm using Docker Toolbox for windows 7, I'm trying to change the ip address of docker0 interface but, having difficulty in finding the exact solution which works for Windows 7. Can anyone please help me in finding the solution.
Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 06:14:34 2016
OS/Arch: linux/amd64
Server:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 06:14:34 2016
OS/Arch: linux/amd64
Thank you.
To change the IP address Docker will set on it's
docker0
interface, you have to use the--bip
option which defines the CIDR (eg.--bip=10.32.57.1/24
), see "Customize the docker0 bridge" in Docker user guide.Docker Toolbox uses Boot2Docker (running in a virtual machine) which is based on the Tiny Core Linux OS.
Docker daemon reads
/var/lib/boot2docker/profile
before starting (see "Local Customisation" in Boot2Docker's FAQ) where aEXTRA_ARGS
variable is ready to be filled with your custom settings.Just add your
--bip=...
inEXTRA_ARGS
's value part and restart the daemon.The following command (to type in the Docker Quickstart Terminal) will stop the Docker daemon, drop any existing rule, delete the interface, add a
--bip
option to/var/lib/boot2docker/profile
and restart the daemon:(Content of
/var/lib/boot2docker
is persisted between Boot2Docker VM restarts so running this command once should suffice)You can check with:
If anyone needs the same manipulation on Debian (without Boot2Docker thus):
For Sysvinit:
For systemd:
Then (for both Sysvinit and systemd):