1

我正在尝试在我的应用程序的无发行版 docker 容器上将 jdk 与 python venv 集成

我无法在 distroless 容器中创建的 venv 中导入 java 模块

如何将 jdk 模块导出到 distroless 容器中,以便应用程序正常工作

Traceback (most recent call last):
  File "sutime_server.py", line 18, in <module>
    sutime = SUTime(jars='jars', mark_time_ranges=True, include_range=True)
  File "/app/sutime/sutime.py", line 47, in __init__
    self._start_jvm()
  File "/app/sutime/sutime.py", line 67, in _start_jvm
    jpype.getDefaultJVMPath(),
  File "/venv/lib/python3.7/site-packages/jpype/_core.py", line 337, in getDefaultJVMPath
    return finder.get_jvm_path()
  File "/venv/lib/python3.7/site-packages/jpype/_jvmfinder.py", line 160, in get_jvm_path
    jvm = method()
  File "/venv/lib/python3.7/site-packages/jpype/_jvmfinder.py", line 215, in _get_from_known_locations
    for home in self.find_possible_homes(self._locations):
  File "/venv/lib/python3.7/site-packages/jpype/_jvmfinder.py", line 120, in find_possible_homes
    for childname in sorted(os.listdir(parent)):
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/jvm'

这是我在运行应用程序时遇到的错误

4

0 回答 0