Binding a port to a host interface using the REST API

后端 未结 3 2067
南笙
南笙 2021-02-05 11:08

The documentation for the commandline interface says the following:

To bind a port of the container to a specific interface of the host system, use the

3条回答
  •  感动是毒
    2021-02-05 11:14

    This is an undocumented feature. I found my answer on the mailing list:

    When creating the container you have to set ExposedPorts:

    "ExposedPorts": { "22/tcp": {} }
    

    When starting your container you need to set PortBindings:

    "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] }
    

    There already is an issue on github about this.

提交回复
热议问题