Home  >  Q&A  >  body text

windows docker-machine port

windows如何设置 docker-machine 的port,默认是2375


这个端口,怎么改

世界只因有你世界只因有你2708 days ago743

reply all(1)I'll reply

  • 为情所困

    为情所困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-mirroradding Alibaba Cloud Accelerator and the like.

    1. 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.

    reply
    0
  • Cancelreply