0

I am trying to do a ./gradlew build in drone using the base image openjdk:8-jdk-alpine. But my java needs to connect to a https source to get some files and it fails while doing this since the base image doesn't have the certificates incorporated.

Is there a way to overcome this? Can we add certificates into drone pipeline or can I try creating an entirely new base jdk image with my certificates incorporated? Below is a snippet of my drone.yml file

pipeline:
  test-build:
    when:
      event: pull_request
    image: openjdk:8-jdk-alpine
    commands:
      - apk --update add bash libstdc++
      - ./gradlew clean build test

Error message:

[ant:xjc] [ERROR] sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

tso
  • 4,732
  • 2
  • 22
  • 32
  • I think @Makoto was a bit too quick to close this as a duplicate as the question pertains to the context of docker. The answer is that you must create a new image, eg FROM openjdk:8-jdk-alpine and install the required CA certs. – Hamish Jul 13 '17 at 17:36
  • @Hamish: The way one would install the CA certs into Java is described by the duplicate. Am I missing something here? – Makoto Jul 13 '17 at 20:00
  • @Makoto: I believe the question was not _how_ to install the CA certs, rather it was whether drone could do this automatically, or if creating a new docker image was necessary. – Hamish Jul 17 '17 at 16:18
  • Thanks for the response guys. But I was able to use the image openjdk:8-jdk to curl the certificates into my image and then use the keytool command in the duplicate to store it in keystore. I don't know if this is efficient way of doing it. But at least, resolved my issue. – Lourdu Felix Jul 19 '17 at 16:43

0 Answers0