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-mirroradding 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.
There are two modification methods:
1. Specify it directly when creating
docker-machine
Supports parameters. You can directly specify its port data when creating: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.