错误:在服务“dsearch”中使用了命名卷“xplore:/root/xPlore/rtdata:rw”,但在卷部分未找到声明
Posted
技术标签:
【中文标题】错误:在服务“dsearch”中使用了命名卷“xplore:/root/xPlore/rtdata:rw”,但在卷部分未找到声明【英文标题】:ERROR: Named volume "xplore:/root/xPlore/rtdata:rw" is used in service "dsearch" but no declaration was found in the volumes section 【发布时间】:2018-12-27 05:02:16 【问题描述】:我想通过使用单个 compose 文件为 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:
【问题讨论】:
VarunRajendran 您在服务之间使用了卷。提取它的格式不正确 volumes: xplore: 在你的服务之间 【参考方案1】:当您尝试将卷创建为当前主机文件夹的子文件夹时,通常会出现此错误。在这种情况下,语法必须是:
volumes:
- ./centdb_odbc:/opt/dctm/odbc
换句话说:缺少相对路径“./”!
【讨论】:
有趣的是错误消息是如何零使用的,并且有一个完整的网站(这个)专门用于破译它。 确实,我同意...这种消息可能对开发人员有所帮助,但对普通 docker 用户来说价值很小。无效架构的消息也是如此。例如,如果您在 armv7 系统上并拉取没有构建 armv7 的映像,则 docker 只是为例如拉取“随机”映像。 amd64,同样失败(在“docker run”上)并带有一条非常无意义的消息......【参考方案2】:映射目录时,源部分必须是绝对路径,或以./
或../
开头的相对部分。否则,Docker 将其解释为命名卷。
所以不是
volumes:
- xplore:/root/xPlore/rtdata
你应该写:
volumes:
- ./xplore:/root/xPlore/rtdata
【讨论】:
【参考方案3】:Volumes 命令应该是 docker compose 中的最后一个命令,包括所有服务的卷名并运行 docker compose。它将创建容器。
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:
【讨论】:
以上是关于错误:在服务“dsearch”中使用了命名卷“xplore:/root/xPlore/rtdata:rw”,但在卷部分未找到声明的主要内容,如果未能解决你的问题,请参考以下文章
如何在主机上为 docker-compose.yml 中的命名卷设置路径