66

I wanted to create containers for tomcat, documentum content server and documentum xplore by using a single compose file. Am facing issues due to the volumes mentioned in the docker-compose.yml file. Am able to bring up the services by executing the compose files separately. Problem is when i try to merge the compose files together. Wanted to know how to run multiple containers with volumes using docker compose.

Below is the single compose file :

  version: '2'
  networks:
          default:
            external:
              name: dctmcs_default
  services:
    dsearch:
      image: xplore_ubuntu:1.6.0070.0058
      container_name: dsearch
      hostname: dsearch
      ports:
        - "9300:9300"
      volumes:
        - xplore:/root/xPlore/rtdata
    indexagent:
    image: indexagent_ubuntu:1.6.0070.0058
    container_name: indexagent_1
    hostname: indexagent_1
    ports:
      - "9200:9200"
    environment:
      - primary_addr=dsearch
      - docbase_name=centdb
      - docbase_user=dmadmin
      - docbase_password=password
      - broker_host=contentserver
      - broker_port=1689
    depends_on:
      - dsearch
    volumes_from:
      - dsearch
volumes:
   xplore: {}
 tomcat_8:
   image: tomcat_8.0:ccms
   container_name: appserver
   hostname: appserver
   ports:
     - "9090:8080"
 contentserver:
   image: contentserver_ubuntu:7.3.0000.0214
   environment:
     - HIGH_VOLUME_SERVER_LICENSE=
     - TRUSTED_LICNESE=
     - STORAGEAWARE_LICENSE=
     - XMLSTORE_LICENSE=
     - SNAPLOCKSTORE_LICENSE=LDNAPJEWPXQ
     - RPS_LICENSE=
     - FED_RECD_SERVICE_LICENSE=
     - RECORD_MANAGER_LICENSE=
     - PRM_LICENSE=
     - ROOT_USER_PASSWORD=password
     - INSTALL_OWNER_PASSWORD=password
     - INSTALL_OWNER_USER=dmadmin
     - REPOSITORY_PASSWORD=password
     - EXTERNAL_IP=10.114.41.198
     - EXTERNALDB_IP=172.17.0.1
     - EXTERNALDB_ADMIN_USER=postgres
     - EXTERNALDB_ADMIN_PASSWORD=password
     - DB_SERVER_PORT=5432
     - DOCBASE_ID=45321
     - DOCBASE_NAME=centdb
     - USE_EXISTING_DATABASE_ACCOUNT=false
     - INDEXSPACE_NAME=dm_repo_docbase
     - BOF_REGISTRY_USER_PASSWORD=password
     - AEK_ALGORITHM=AES_256_CBC
     - AEK_PASSPHRASE=${AEK_PASSPHRASE}
     - AEK_NAME=aek.key
     - ENABLE_LOCKBOX=false
     - LOCKBOX_FILE_NAME=lockbox.lb
     - LOCKBOX_PASSPHRASE=${LOCKBOX_PASSPHRASE}
     - USE_EXISTING_AEK_LOCKBOX=false
     - CONFIGURE_THUMBNAIL_SERVER=NO
     - EXTDOCBROKERPORT=1689
     - CONTENTSERVER_PORT=50000
     - APP_SERVER_ADMIN_PASSWORD=jboss
     - INSTALL_OWNER_UID=
   hostname:
     "contentserver"
   container_name:
     "contentserver"
   ports:
    - "1689:1689"
    - "1690:1690"
    - "50000:50000"
    - "50001:50001"
    - "9080:9080"
    - "9082:9082"
    - "9081:9081"
    - "8081:8081"
    - "8443:8443"
    - "9084:9084"
   volumes:
    - centdb_odbc:/opt/dctm/odbc
    - centdb_data:/opt/dctm/data
    - centdb_dba:/opt/dctm/dba
    - centdb_share:/opt/dctm/share
    - centdb_dfc:/opt/dctm/config
    - centdb_xhive_storage:/opt/dctm/xhive_storage
    - centdb_XhiveConnector:/opt/dctm/wildfly9.0.1/server/DctmServer_MethodServer/deployments/XhiveConnector.ear
    - centdb_mdserver_conf:/opt/dctm/mdserver_conf
    - centdb_mdserver_log:/opt/dctm/wildfly9.0.1/server/DctmServer_MethodServer/log
    - centdb_mdserver_logs:/opt/dctm/wildfly9.0.1/server/DctmServer_MethodServer/logs
    - centdb_Thumbnail_Server_conf:/opt/dctm/product/7.3/thumbsrv/conf
    - centdb_Thumbnail_Server_webinf:/opt/dctm/product/7.3/thumbsrv/container/webapps/thumbsrv/WEB-INF
   privileged: true
volumes:
 centdb_data:
    driver: local


 centdb_dba:
 centdb_share:
    driver: local


 centdb_dfc:
 centdb_odbc:
 centdb_XhiveConnector:
 centdb_mdserver_conf:
 centdb_mdserver_log:
 centdb_mdserver_logs:
 centdb_Thumbnail_Server_conf:
 centdb_Thumbnail_Server_webinf:
 centdb_xhive_storage:
isapir
  • 21,295
  • 13
  • 115
  • 116
VarunRajendran
  • 771
  • 1
  • 5
  • 8

3 Answers3

97

This error often appears when you are trying to create a volume as a subfolder of your current host folder. In that case, the syntax would have to be:

volumes:
    - ./centdb_odbc:/opt/dctm/odbc

In other words: The relative path "./" is missing!

rt87
  • 1,123
  • 7
  • 8
  • 4
    interesting how the error message is of zero use and there is an entire website (this one) dedicated to deciphering it. – sprajagopal May 28 '21 at 09:31
  • Indeed, I agree... That kind of message may help a developer, but is of very little value to the ordinary docker user. The same goes for the message for an invalid architecture. If you are, e.g., on an armv7 system und pull an image for which there is no armv7 built, docker just pulls a "random" image for, e.g. amd64, and similarly fails (on "docker run") with a pretty nonsense message... – rt87 May 30 '21 at 09:52
30

When you map a directory, the source part must be either an absolute path, or a relative part that begins with ./ or ../. Otherwise, Docker interprets it as a Named Volume.

So instead of

volumes:
    - xplore:/root/xPlore/rtdata

You should write:

volumes:
    - ./xplore:/root/xPlore/rtdata
isapir
  • 21,295
  • 13
  • 115
  • 116
11

Volumes Command should be the last command in docker compose include volume names of all services together and run the docker compose. It will create containers.

volumes:
 xplore: {}
 centdb_data:
    driver: local


 centdb_dba:
 centdb_share:
    driver: local


 centdb_dfc:
 centdb_odbc:
 centdb_XhiveConnector:
 centdb_mdserver_conf:
 centdb_mdserver_log:
 centdb_mdserver_logs:
 centdb_Thumbnail_Server_conf:
 centdb_Thumbnail_Server_webinf:
 centdb_xhive_storage:
VarunRajendran
  • 771
  • 1
  • 5
  • 8