windows docker-machine port

  docker, question

How does windows set docker-machine’s port? The default is 2375

clipboard.png
How to change this port

There are two ways to modify:

1. Specify directly when creating

docker-machineA that supports parameters. You can specify its port data directly when creating:

docker-machine create -d virtualbox \
 --engine-opt host=tcp://0.0.0.0:12345
 sandbox

It is suggested to look at the official website document:https://docs.docker.com/machine/reference/create/

Some parameters with Chinese characteristics should be added initially, such as--registry-mirror, join ariyun accelerator, etc.

  1. Manually modify the established docker host

It is more complicated to modify the established host, which needs to be modified in the virtual machine at the same time./var/lib/boot2docker/profileFile, and modify the native~/.docker/machine/machines/xxxxx/config.jsonDocuments.

If the modification is not correct, it will not be connected, anddocker-machine upgradeAfter that, these configurations are easily lost. So try to use it beforecreateWhen adding parameters.