我在Dockerfile
JAVA上有一个1.7.0_45
建筑,我想在其中安装jython
。这就是我根据this实现这一点的方法:
FROM java:7.0_45
MAINTAINER Zeinab Abbasimazar (zeinab.abbasi@peykasa.ir)
ENV JYTHON_VERSION=2.7.0
RUN apt-get update; \
apt-get install -y --no-install-recommends apt-utils; \
apt-get install -y curl; \
curl -Lo jython-installer-$JYTHON_VERSION.jar \
"http://search.maven.org/remotecontent?filepath=org/python/jython-installer/$JYTHON_VERSION/jython-installer-$JYTHON_VERSION.jar"; \
java -jar jython-installer-$JYTHON_VERSION.jar -s -t minimum -i mod -i ensurepip -d /usr/local/jython-$JYTHON_VERSION; \
rm -f jython-installer-$JYTHON_VERSION.jar; \
ln -s /usr/local/jython-$JYTHON_VERSION/bin/* /usr/local/bin/
RUN java -version
ENTRYPOINT ["bash"]
从内部存储库下载java:7.0_45
。
java -version
的输出是:
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
在构建阶段,我得到了这个:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 161 100 161 0 0 195 0 --:--:-- --:--:-- --:--:-- 195
100 88.5M 100 88.5M 0 0 113k 0 0:13:22 0:13:22 --:--:-- 117k
Performing silent installation
10 %
20 %
30 %
40 %
50 %
60 %
Generating start scripts ...
Installing pip and setuptools
90 %
Traceback (most recent call last):
File "/usr/local/jython-2.7.0/Lib/runpy.py", line 161, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/jython-2.7.0/Lib/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/jython-2.7.0/Lib/ensurepip/__main__.py", line 4, in <module>
ensurepip._main()
File "/usr/local/jython-2.7.0/Lib/ensurepip/__init__.py", line 220, in _main
bootstrap(
File "/usr/local/jython-2.7.0/Lib/ensurepip/__init__.py", line 123, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/usr/local/jython-2.7.0/Lib/ensurepip/__init__.py", line 45, in _run_pip
import pip
File "/tmp/tmpt9RVvB/pip-1.6-py2.py3-none-any.whl/pip/__init__.py", line 10, in <module>
File "/tmp/tmpt9RVvB/pip-1.6-py2.py3-none-any.whl/pip/util.py", line 17, in <module>
File "/tmp/tmpt9RVvB/pip-1.6-py2.py3-none-any.whl/pip/locations.py", line 109, in <module>
File "/tmp/tmpt9RVvB/pip-1.6-py2.py3-none-any.whl/pip/locations.py", line 71, in _get_build_prefix
File "/tmp/tmpt9RVvB/pip-1.6-py2.py3-none-any.whl/pip/locations.py", line 66, in __get_username
File "/usr/local/jython-2.7.0/Lib/pwd.py", line 60, in getpwuid
return struct_passwd(entry)
File "/usr/local/jython-2.7.0/Lib/pwd.py", line 36, in __new__
pwd = (newStringOrUnicode(pwd.loginName), newStringOrUnicode(pwd.password), int(pwd.UID),
NotImplementedError: passwd.pw_passwd unimplemented
100 %
Congratulations! You successfully installed Jython 2.7.0 to directory /usr/local/jython-2.7.0.
虽然jython
在运行阶段运行良好,但我很好奇导致此错误的原因。任何可以提供帮助的信息?
编辑1:
我应该提一下,在ubuntu 16.04
系统上安装它没有问题。
答案 0 :(得分:0)
我已经通过在apt-get下载列表中添加python解决了这个问题:
Export-Csv -Delimiter "\t"
现在,这是输出:
apt-get install -y curl python2.7 python-dev