代码之家  ›  专栏  ›  技术社区  ›  Holly

Docker容器中的JetBrains/TeamTools“无法侦听地址0.0.0.0和端口443”

  •  0
  • Holly  · 技术社区  · 6 年前

    问题

    我正在尝试在Docker容器中设置JetBrains Hub、YouTrack、Upsource和TeamCity,并将它们配置为在各自的IP(MacVLAN)上可用,默认端口80重定向到443和443,用于https(因此端口号不会显示在浏览器中)。

    但是,如果我这样做,我会得到:

    无法侦听地址0.0.0.0和端口443

    将teamtools保留在默认端口8080和8443上,或者将端口设置为2000以上似乎也可以。

    我查过了 fuser 443/tcp netstat -tulpn 但是在80号或443号端口上没有任何东西。 (必须为容器中的程序包安装)

    我尝试将侦听地址设置为nics ip或172.0.0.1,但也被拒绝:

    root@teamtools [ /opt/teamtools ]# docker run --rm -it \
        -v /opt/hub/data:/opt/hub/data \
        -v /opt/hub/conf:/opt/hub/conf \
        -v /opt/hub/logs:/opt/hub/logs \
        -v /opt/hub/backups:/opt/hub/backups \
        jetbrains/hub:2018.2.9840 \
        configure --listen-address=192.168.1.211
    * Configuring JetBrains Hub 2018.2
    * Setting property 'listen-address' to '192.168.1.211' from arguments
    [APP-WRAPPER] Failed to configure Hub: java.util.concurrent.ExecutionException: com.jetbrains.bundle.exceptions.BadConfigurationException: Could not listen on address {192.168.1.211} . Please specify another listen address in property listen-address
    

    问题:

    1. 为什么我不能设置端口80和443?
    2. 为什么它对 2000年?
    3. 在没有反向代理的情况下,我如何才能使此工作? (反向代理还有一大堆其他问题,我正试图通过此设置避免这些问题)

    安装程序

    ESXi 6.7 Host
      - vSwitch0 (Allow promiscuous mode:   Yes)
         - port group: VM Netork (Allow promiscuous mode:   No)
           - other VMs
         - port group: Promiscuous Ports (Allow promiscuous mode:   Yes)
           - Teamtools VM (Photon OS 2.0, IP: 192.168.1.210)
             - firewall based on: https://unrouted.io/2017/08/15/docker-firewall/
             - docker/docker-compose
               - hub                         (IP: 192.168.1.211:80/443)
               - youtrack                    (IP: 192.168.1.212:80/443)
               - upsource                    (IP: 192.168.1.213:80/443)
               - teamcity-server             (IP: 192.168.1.214:80/443)
               - teamcity_db (MariaDB 10.3)  (IP: 192.168.1.215:3306)
    

    docker-compose.yml文件

    version: '2'
    networks:
      macnet:
        driver: macvlan
        driver_opts:
          parent: eth0
        ipam:
          config:
            - subnet: 192.168.1.0/24
              gateway: 192.168.1.1 
    
    services:
      hub:
        # set a custom container name so no more than one container can be created from this config
        container_name: hub
        image: "jetbrains/hub:2018.2.9840"
        restart: unless-stopped
        volumes:
          - /opt/hub/data:/opt/hub/data
          - /opt/hub/conf:/opt/hub/conf
          - /opt/hub/logs:/opt/hub/logs
          - /opt/hub/backups:/opt/hub/backups
          - /opt/teamtools:/opt/teamtools
        expose:
          - "80"
          - "443"
          - "8080"
          - "8443"
        networks:
          macnet:
            ipv4_address: 192.168.1.211
        domainname: office.mydomain.com
        hostname: hub
        environment:
          - "JAVA_OPTS=-J-Djavax.net.ssl.trustStore=/opt/teamtools/certs/keyStore.p12 -J-Djavax.net.ssl.trustStorePassword=xxxxxxxxxxxxxx"
    ...
    
    1 回复  |  直到 6 年前
        1
  •  2
  •   tora    6 年前
    推荐文章