cirton
V2EX  ›  Docker

使用动态端口的程序是不是不适合部署在 docker 上?

  •  
  •   cirton · Jan 2, 2020 · 4200 views
    This topic created in 2330 days ago, the information mentioned may be changed or developed.
    程序对外的端口是动态的,这种情况下就没办法提前在 docker 上暴露端口,这种情况是不是不适合使用 docker 环境?
    slwl123
        1
    slwl123  
       Jan 2, 2020
    使用 --net=host
    cirton
        2
    cirton  
    OP
       Jan 3, 2020
    @slwl123 这种只适合单节点的情况吧?现在搭建集群时,多个节点都需要暴露相同的端口,比如主机 A 和主机 B 都需要暴露 22 端口,这种模式是不是就不合适了?
    XSG
        3
    XSG  
       Jan 3, 2020
    可以参考 ftp 服务,把一定范围的端口暴露出去,比如 10000-10010
    slwl123
        4
    slwl123  
       Jan 3, 2020
    @cirton #2 应该可以 但是每个 node 只能 运行一个 pod 并且 node 里的端口没被占用
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3493 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 80ms · UTC 04:47 · PVG 12:47 · LAX 21:47 · JFK 00:47
    ♥ Do have faith in what you're doing.