首页 > 解决方案 > 加载共享库 test/libaegean.dll 时出错:没有这样的文件或目录

问题描述

我正在为 Spring Boot 示例应用程序从 dockerfile 构建图像,使用 COPY 命令将本地文件(我需要作为 vm 参数传递)从主机复制到我的容器中。docker 在 windows 10 和 linux 容器上运行。当我尝试运行图像时,它显示的错误与

Could not find agent library test/libaegean.dll in absolute path, with error: Error loading shared library test/libaegean.dll: No such file or directory.

这是我的 Dockerfile

FROM openjdk:8-jdk-alpine
RUN mkdir test
RUN chmod +x test
COPY libaegean.dll test
COPY dellicence.lic test
COPY application-0.0.1-SNAPSHOT.jar test
WORKDIR test
EXPOSE 6070
ENTRYPOINT ["java","-agentpath:test/libaegean.dll","-jar","application-0.0.1-SNAPSHOT.jar"]

这就是我构建图像的方式

docker image build --file=Dockerfile --tag=sample .

这就是我运行容器的方式

docker container run --name=sample sample

请看图片有一个清晰的想法。提前感谢您的帮助。

docker构建镜像成功

码头工人运行失败

标签: javaspring-bootdockerdockerfile

解决方案


推荐阅读