java - 加载共享库 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
请看图片有一个清晰的想法。提前感谢您的帮助。
解决方案
推荐阅读
- arrays - 将新项目插入到 JSONB_SET 中嵌套数组的 json 对象中
- c# - 如何使用没有数据库的 C# 构建从 DataGridView 中删除行的方法
- javascript - 如何在多行字符串中找到字符位置(行,列)?
- jquery - 图像轮播在不同的浏览器上无法正确显示
- google-cloud-datalab - 我无法在 Google Cloud Datalab 上使用“云翻译 API”
- visual-studio - 在 Visual Studio 的拆分窗口中打开已在另一个窗口中打开的文件
- reactjs - 外部化 react 和 react-dom 依赖项是否会增加反应应用程序的加载时间
- spring-boot - spring boot 如何分别为管理员和用户配置安全性
- c# - 从 C# 中的文件开头写入二进制文件块
- zapier - Zapier API 配置:发送表单数据而不是 json 请求正文