Docker Community Forums

Share and learn in the Docker community.

What I did wrong in my docker compose yml? Getting port conflict

After starting docker-compose yml, the port 5080 is getting conflict. I have attached the YML file.
But I do not know if I did something wrong on docker-compose.yml.

$ docker-compose -f docker-compose-auth-v9011.yml up -d
Starting images_xc_1      ... done
Recreating images_utils_1 ... done
Starting images_db_1      ... done
Recreating images_txn_1   ... error

ERROR: for images_txn_1  Cannot start service txn: driver failed programming external connectivity on endpoint images_txn_1 (1dbb46b53952cf25da7229578b9c80bd38f91e5effe76ef519df4e4b270e8b59): Error starting userland proxy: Bind for 0.0.0.0:5080: unexpected error Permission denied
Starting images_search_master_1 ... done

ERROR: for txn  Cannot start service txn: driver failed programming external connectivity on endpoint images_txn_1 (1dbb46b53952cf25da7229578b9c80bd38f91e5effe76ef519df4e4b270e8b59): Error starting userland proxy: Bind for 0.0.0.0:5080: unexpected error Permission denied
ERROR: Encountered errors while bringing up the project.

AzureAD+IgorMonteiroVieira@DESKTOP-FEIKH4N MINGW64 ~/Box Sync/Commerce/Prototype/Images
$ docker container ls
CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS                             PORTS                                            NAMES
69a04e6193d4        commerce/ts-utils:9.0.1.1     "/SETUP/bin/entrypoi…"   58 seconds ago      Up 54 seconds (healthy)            5080/tcp, 5443/tcp                               images_utils_1
1f2799e8950b        commerce/search-app:9.0.1.1   "/SETUP/bin/entrypoi…"   20 minutes ago      Up 22 seconds (health: starting)   0.0.0.0:3737-3738->3737-3738/tcp                 images_search_master_1
e3521501461f        commerce/xc-app:9.0.1.1       "/SETUP/bin/entrypoi…"   21 minutes ago      Up 55 seconds                      0.0.0.0:9080->9080/tcp, 0.0.0.0:9443->9443/tcp   images_xc_1
669acff390e8        commerce/ts-db:9.0.1.1        "/bin/bash /SETUP/bi…"   21 minutes ago      Up 55 seconds (healthy)            0.0.0.0:50000->50000/tcp, 50001/tcp              images_db_1

version: "2.1" 
services: 
#####################################################################################################################t.                                                                                                   
##################################################################################################################### 
  db: 
    image: commerce/ts-db:9.0.1.1 
    hostname: auth_db 
    privileged: true 
    environment: 
      - LICENSE=accept 
      - TZ=Toronto/Canada 
    ports: 
      - 50000:50000 
    healthcheck: 
      test: exit 0 


######################################################################################################### 
######################################################################################################### 
## - adminPassword=passw0rd 
  txn: 
    image: commerce/ts-app:9.0.1.1 
    hostname: auth_txn 
    environment: 
      - LICENSE=accept 
      - TZ=Toronto/Canada 
      - adminPassword= 
      - DBHOST=db 
      - DBNAME=mall 
      - DBPORT=50000 
      - DBUSER=wcs 
      - DBPASS=wcs1 
    volumes: 
      - /opt/logs/TX:/opt/WebSphere/AppServer/profiles/default/logs/container 
    ports: 
      - 5080:5080 
      - 5443:5443 
      - 9060:9060 
      - 9043:9043 
    networks: 
      default: 
        aliases: 
          - app 
    depends_on: 
      db: 
        condition: service_started 
    healthcheck: 
      test: curl -f http://localhost:5080/wcs/resources/health/ping 
      interval: 10s 
      timeout: 180s 
      retries: 100 
      
      
##################################################################################################################################m 
################################################################################################################################## 
  web: 
    image: commerce/ts-web:9.0.1.1 
    hostname: auth_web 
    environment: 
      - LICENSE=accept 
      - TZ=Toronto/Canada 
    volumes: 
      - /opt/logs/TX-web/Plugin:/opt/WebSphere/Plugins/logs 
      - /opt/logs/TX-web/HTTPServer:/opt/WebSphere/HTTPServer/logs 
    ports: 
      - 80:80 
      - 443:443 
      - 8000-8002:8000-8002 
      - 8004:8004 
    depends_on: 
      txn: 
        condition: service_healthy 
    healthcheck: 
      test: exit 0 
    

################################################################################################################################################################################################################## 
  search_master: 
    image: commerce/search-app:9.0.1.1 
    hostname: search_master 
    environment: 
      - SOLR_MASTER=true 
      - SOLR_SLAVE=false 
      - WORKAREA=/search 
      - LICENSE=accept 
      - TZ=Toronto/Canada 
    volumes: 
      - /opt/logs/search:/opt/WebSphere/Liberty/usr/servers/default/logs/container 
    ports: 
      - 3737:3737 
      - 3738:3738 
    depends_on: 
      db: 
        condition: service_healthy 
    networks: 
      default: 
        aliases: 
          - search         
    healthcheck: 
      test: ["CMD", "curl", "-f", "-H", "Authorization: Basic c3BpdXNlcjpwYXNzdzByZA==", "http://localhost:3737/search/admin/resources/health/ping"] 
      interval: 10s 
      timeout: 180s 
      retries: 100 


######################################################################################################### 
######################################################################################################### 
  store: 
    image: commerce/crs-app:9.0.1.1 
    hostname: auth_store 
    environment: 
      - LICENSE=accept 
      - TZ=Toronto/Canada 
    volumes: 
      - /opt/logs/store:/opt/WebSphere/Liberty/usr/servers/default/logs/container 
    ports: 
      - 8080:8080 
      - 8443:8443 
    depends_on: 
      txn: 
        condition: service_healthy 
      search_master: 
        condition: service_healthy         
    healthcheck: 
      test: curl -f http://localhost:8080/wcs/HealthCheck.jsp 
      interval: 10s 
      timeout: 180s 
      retries: 100 


################################################################################################################################# 
#################################################################################################################################       
  xc: 
    image: commerce/xc-app:9.0.1.1 
    hostname: auth_xc 
    environment: 
      - LICENSE=accept 
      - TZ=Toronto/Canada 
    volumes: 
      - /opt/logs/xC:/opt/WebSphere/Liberty/usr/servers/default/logs/container 
    ports: 
      - 9080:9080 
      - 9443:9443       

#################################################################################################################################                 
################################################################################################################################# 
  utils: 
    image: commerce/ts-utils:9.0.1.1 
    hostname: auth_utils 
    environment: 
      - LICENSE=accept 
      - DBHOST=db 
      - DBNAME=mall 
      - DBPORT=50000 
      - DBUSER=wcs 
      - DBPASS=wcs1 
      - DBADMIN=db2inst1 
      - ENABLE_DB_SSL=false 
    volumes: 
        - /opt/logs/utils/product_level:/opt/WebSphere/CommerceServer90/logs 
        - /opt/logs/utils/instance_level:/opt/WebSphere/CommerceServer90/instances/demo/logs 
    tty: true 
    stdin_open: true 
    healthcheck: 
      test: exit 0

Sorry, new users cannot upload files. So I had to paste the content of docker-compose.yml .
As you know, the port 5080 is getting conflict, but I do not know what I need to fix on the YML file

This means another application is already running on port 5080.

1 Like

Hi.sbut I do not know what I did wrong in my Docker compose file because I need that port published in two different containers

I do not know why the container “utils” is trying to bring up the port. I did set for TXN Container

The question is, do you really need all these published ports? You publish a port to make it available (for you) at localhost:portnumber. For the communication between the containers you don’t have to publish anything.

The problem was solved with this command: docker container prune