vagrant port

Port

Command: vagrant port [name|id]

The port command displays the full list of guest ports mapped to the host machine ports:

$ vagrant port
    22 (guest) => 2222 (host)
    80 (guest) => 8080 (host)

In a multi-machine Vagrantfile, the name of the machine must be specified:

$ vagrant port my-machine

Options

  • --guest PORT - This displays just the host port that corresponds to the given guest port. If the guest is not forwarding that port, an error is returned. This is useful for quick scripting, for example:

    $ ssh -p $(vagrant port --guest 22)
    
  • --machine-readable - This tells Vagrant to display machine-readable output instead of the human-friendly output. More information is available in the machine-readable output documentation.

© 2010–2017 Mitchell Hashimoto
Licensed under the MPL 2.0 License.
https://www.vagrantup.com/docs/cli/port.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部