Share wont start becasue of same port

cancel
Showing results for 
Search instead for 
Did you mean: 
mangar
Established Member

Share wont start becasue of same port

I am trying to docker compose ACS and share.  The ACS comes up fine if I run it individually.  but when I add Share to my docker compose file,  I get this error: 

 

Removing docker_alfresco-share_1
Starting docker_alfresco-acs_1 ... 
Recreating c52757e9921c_docker_alfresco-share_1 ... 
Recreating c52757e9921c_docker_alfresco-share_1 ... error

Starting docker_alfresco-acs_1                  ... done
r 0.0.0.0:8888 failed: port is already allocated

ERROR: for alfresco-share  Cannot start service alfresco-share: driver failed programming external connectivity on endpoint docker_alfresco-share_1 (e7b5bb2dd1cba3372581e3e43438a46c63ff5c81554087995ef3fb88167a4e82): Bind for 0.0.0.0:8888 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

Here is my docker-compose.yml

 

version: '3.4'
services:
  alfresco-share:
    image: my.share:7.0.0
    environment:
      CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888"
      REPO_HOST: alfresco-acs
      REPO_PORT: 8080
    ports:
      - "8080:8080"
      - "8888:8888"
  alfresco-acs:
    image: my.alfresco:7.0.0
    environment:
      JAVA_TOOL_OPTIONS: "-Dencryption.keystore.type=JCEKS
            -Dencryption.cipherAlgorithm=AES/CBC/PKCS5Padding
            -Dencryption.keyAlgorithm=AES
            -Dencryption.keystore.location=/usr/local/tomcat/shared/classes/alfresco/extension/keystore/keystore
            -Dmetadata-keystore.password=mp6yc0UD9e
            -Dmetadata-keystore.aliases=metadata
            -Dmetadata-keystore.metadata.password=oKIWzVdEdA
            -Dmetadata-keystore.metadata.algorithm=AES"
      CATALINA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8888"
    ports:
      - "8080:8080"
      - "8888:8888"
    volumes:
      - alfresco-acs-volume:/usr/local/tomcat/alf_data
volumes:
  alfresco-acs-volume:
    external: true

How do I tell it to use the same tomcat and the same port?

2 Replies
narkuss
Established Member II

Re: Share wont start becasue of same port

You can't publish the same port for acs and share in docker. You should change your share ports to:

"8180:8080"

"8889:8888"

Hope this helps

sufo
Established Member II

Re: Share wont start becasue of same port

By default, docker compose runs two separate docker images for share and acs, so you get two tomcats running and need different ports for them.

You will need to build your own docker image with share and acs wars deployed to the same tomcat if you want it that way.