我想通过使用一个撰写文件来为tomcat,documentum内容服务器和documentum xplore创建容器。由于docker-compose.yml文件中提到的卷而面临问题。能够通过分别执行撰写文件来调出服务。问题是当我尝试将撰写文件合并在一起时。想知道如何使用docker compose运行具有卷的多个容器。

以下是单个撰写文件:

  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:

最佳答案

当您尝试将卷创建为当前主机文件夹的子文件夹时,通常会出现此错误。在这种情况下,语法必须为:

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

换句话说:相对路径“./”丢失了!

关于linux - 错误: Named volume “xplore:/root/xPlore/rtdata:rw” is used in service “dsearch” but no declaration was found in the volumes section,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51416182/

10-13 08:55