如何使用openjdk:7 Docker映像和Gradle包装器避免EC参数错误? [英] How to avoid `EC parameters error` using the openjdk:7 Docker image and a Gradle wrapper?

查看:113
本文介绍了如何使用openjdk:7 Docker映像和Gradle包装器避免EC参数错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此Dockerfile:

This Dockerfile:

FROM openjdk:7

WORKDIR /restdocs/
RUN git clone https://github.com/spring-projects/spring-restdocs.git /restdocs
RUN git checkout v1.1.2.RELEASE

RUN ./gradlew build

使用 docker build构建。 -t rest-notes 导致以下错误:
线程主中的异常javax.net.ssl.SSLException:java.security.ProviderException:java。 security.InvalidKeyException:EC参数错误

我该如何在Dockerfile中避免这种情况并使Gradle包装器工作?

What can I do in the Dockerfile to avoid this and make the Gradle wrapper work?

推荐答案

感谢Erich Seifert及其在这里的贡献,我得以解决这个问题: https://github.com/eseifert/gral/commit/c24e08a91952a99b8c8b686a1b172335db8cdf87 。更新的Dockerfile有效:

I was able to get around this thanks to Erich Seifert and his commit here: https://github.com/eseifert/gral/commit/c24e08a91952a99b8c8b686a1b172335db8cdf87. Updated Dockerfile that works:

FROM openjdk:7

RUN apt-get update && apt-get install sudo

# Fix the EC parameters error: (ref https://github.com/travis-ci/travis-ci/issues/8503)
RUN sudo wget "https://bouncycastle.org/download/bcprov-ext-jdk15on-158.jar" -O "${JAVA_HOME}"/jre/lib/ext/bcprov-ext-jdk15on-158.jar && \
  sudo perl -pi.bak -e 's/^(security\.provider\.)([0-9]+)/$1.($2+1)/ge' /etc/java-7-openjdk/security/java.security && \
  echo "security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider" | sudo tee -a /etc/java-7-openjdk/security/java.security

WORKDIR /restdocs/
RUN git clone https://github.com/spring-projects/spring-restdocs.git /restdocs
RUN git checkout v1.1.2.RELEASE

RUN ./gradlew build

(不要介意spring-restdocs分支的构建失败-与EC参数错误无关:)

(Never mind that the build of that spring-restdocs branch fails - that's not related to the EC parameters error:)

这篇关于如何使用openjdk:7 Docker映像和Gradle包装器避免EC参数错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆