我的docker 17.03.1-ce的Dockerfile如下
FROM ubuntu:16.04
# Specifying versions is better??
RUN apt-get update && \
apt-get install -y \
python3 \
python3-pip \
git \
gradle \
vim \
wget \
openjdk-8-jdk
RUN pip3 install esrally
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash esrally
USER esrally
WORKDIR /home/esrally
RUN echo "export http_proxy=${http_proxy}" > /home/esrally/.bashrc
RUN git config --global http.proxy ${http_proxy}
RUN esrally configure --assume-defaults
RUN esrally list tracks
RUN mkdir ~/.rally/benchmarks/tracks/default/tsgraph
COPY track-tsgraph/*.json /home/esrally/.rally/benchmarks/tracks/default/tsgraph/
RUN mkdir /home/esrally/esrally-docker
COPY . /home/esrally/esrally-docker/
RUN mkdir -p /home/esrally/downloads; \
cd /home/esrally/downloads; \
wget wget -e use_proxy=yes -e HTTP_PROXY=${http_proxy} http://www-eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz; \
cd /home/esrally; tar -zxvf /home/esrally/downloads/apache-maven-3.3.9-bin.tar.gz;
它目前有 jdk 8。但是当我创建一个容器并尝试在其上运行试运行“esrally”时,它要求我安装 jdk10。
____ ____
/ __ \____ _/ / /_ __
/ /_/ / __ `/ / / / / /
/ _, _/ /_/ / / / /_/ /
/_/ |_|\__,_/_/_/\__, /
/____/
[WARNING] No Internet connection detected. Automatic download of track data sets etc. is disabled.
[INFO] Preparing for race ...
[ERROR] Cannot race. ('JAVA_HOME points to JDK 8 but it should point to JDK 10.', None)
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/esrally/mechanic/mechanic.py", line 540, in receiveMsg_StartNodes
msg.distribution, msg.external, msg.docker)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/esrally/mechanic/mechanic.py", line 631, in create
s = supplier.create(cfg, sources, distribution, build, challenge_root_path, car, plugins)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/esrally/mechanic/supplier.py", line 27, in create
java_home = _java_home(car)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/esrally/mechanic/supplier.py", line 81, in _java_home
_, path = jvm.resolve_path(int(build_jdk))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/esrally/utils/jvm.py", line 94, in resolve_path
return majors, _resolve_single_path(majors, sysprop_reader=sysprop_reader)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/esrally/utils/jvm.py", line 134, in _resolve_single_path
java_home = do_resolve(generic_env_var, major)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/esrally/utils/jvm.py", line 121, in do_resolve
raise exceptions.SystemSetupError("{} points to JDK {} but it should point to JDK {}.".format(env_var, actual_major, major))
esrally.exceptions.SystemSetupError: ('JAVA_HOME points to JDK 8 but it should point to JDK 10.', None)
Getting further help:
*********************
* Check the log files in /Users/ndoke/.rally/logs for errors.
* Read the documentation at https://esrally.readthedocs.io/en/1.0.0/
* Ask a question on the forum at https://discuss.elastic.co/c/elasticsearch/rally
* Raise an issue at https://github.com/elastic/rally/issues and include the log files in /Users/ndoke/.rally/logs.
-------------------------------
[INFO] FAILURE (took 2 seconds)
-------------------------------
有人能告诉我为什么会发生这种情况吗?如果没有解决方法来使用 jdk 8 运行它。有人可以告诉我在 docker 中安装 jdk 10 的分步过程吗?
答案1
.rally/benchmarks/teams/默认/汽车/v1/香草
编辑 config.ini 文件以获取正确的 Java 版本