gpt4 book ai didi

docker - docker容器 “Could not listen on address 0.0.0.0 and port 443”中的JetBrains/Teamtools

转载 作者:行者123 更新时间:2023-12-02 21:15:34 28 4
gpt4 key购买 nike

问题

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

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

Could not listen on address 0.0.0.0 and port 443



将teamtools保留在其默认端口8080和8443上,或者给它们提供超过2000的端口似乎也可以。

我检查了 fuser 443/tcpnetstat -tulpn,但端口80或443上没有任何运行。(必须在容器中安装那些软件包)

我尝试将侦听地址设置为NIC 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

问题:
  • 为什么不能设置端口80和443?
  • 为什么对以上端口有效
    2000?
  • 如何在没有反向代理的情况下完成这项工作?
    (reverse-proxy附带了很多其他问题,我尝试通过此设置避免)


  • 设置
    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"
    ...

    最佳答案

    上游是由非root用户jetbrans运行的。
    https://www.w3.org/Daemon/User/Installation/PrivilegedPorts.html

    关于docker - docker容器 “Could not listen on address 0.0.0.0 and port 443”中的JetBrains/Teamtools,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51104771/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com