您现在的位置是:首页 >技术教程 >nacos运行报错-jar: file does not exist&Can‘t retrieve image ID from build stream网站首页技术教程
nacos运行报错-jar: file does not exist&Can‘t retrieve image ID from build stream
简介nacos运行报错-jar: file does not exist&Can‘t retrieve image ID from build stream
一、问题
Deploying 'nacos Dockerfile: ruoyi-visual/ruoyi-nacos/Dockerfile'…
Building image…
Preparing build context archive…
[==================================================>]211/211 files
Done
Sending build context to Docker daemon…
[==================================================>] 6.099MB
Done
Step 1/8 : FROM openjdk:11
---> 5505a9a39df1
Step 2/8 : MAINTAINER Lion Li
---> Using cache
---> eca0c2bdad4a
Step 3/8 : RUN mkdir -p /ruoyi/nacos
---> Using cache
---> be0c071dd7d6
Step 4/8 : WORKDIR /ruoyi/nacos
---> Using cache
---> 408180929007
Step 5/8 : EXPOSE 8848
---> Using cache
---> 1595df8aa2ff
Step 6/8 : ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms256m -Xmx512m"
---> Using cache
---> 899b953e7851
Step 7/8 : ADD ./target/ruoyi-nacos.jar ./app.jar
Error response from daemon: ADD failed: file not found in build context or excluded by .dockerignore: stat target/ruoyi-nacos.jar: file does not exist
Failed to deploy 'nacos Dockerfile: ruoyi-visual/ruoyi-nacos/Dockerfile': Can't retrieve image ID from build stream
报错截图:
二、解决
2.1 以管理员身份运行IDEA
2.2 检查对应的Dockfile文件的配置
检查ruoyi-nacos.jar相关内容是否配置有误:
2.3 maven操作
双击clean:
双击package:
already in use by container:
删除nacos containers改用docker compose 方式启动:
nacos运行报错-jar: file does not exist&Can’t retrieve image ID from build stream 问题解决了。
这里又会报一个常见的错误: No DataSource set
nacos: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memoryMonitor' defined in URL [jar:file:/ruoyi/nacos/app.jar!/BOOT-INF/lib/nacos-config-2.2.1.jar!/com/alibaba/nacos/config/server/monitor/MemoryMonitor.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'asyncNotifyService': Unsatisfied dependency expressed through field 'dumpService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'externalDumpService': Invocation of init method failed; nested exception is ErrCode:500, ErrMsg:Nacos Server did not start because dumpservice bean construction failure :
nacos: No DataSource set
三、参考资料
风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。