windows如何设置 docker-machine 的port,默认是2375
这个端口,怎么改
为情所困2017-04-24 16:01:09
There are two modification methods:
1. Specify it directly when creating
docker-machine
Supports parameters. You can directly specify its port data when creating:
docker-machine create -d virtualbox \
--engine-opt host=tcp://0.0.0.0:12345
sandbox
It is recommended to take a look at the official website documentation: https://docs.docker.com/machine/reference/create/
There are some parameters with Chinese characteristics that should be added initially, such as --registry-mirror
adding Alibaba Cloud Accelerator and the like.
Manually modify the created docker host
It is more complicated to modify the already established host. You need to modify the /var/lib/boot2docker/profile
文件,以及修改本机的 ~/.docker/machine/machines/xxxxx/config.json
file in the virtual machine at the same time.
If the modification is incorrect, the connection will not be possible, and docker-machine upgrade
之后这些配置容易丢失。所以尽量使用之前在 create
is the way to add parameters.