简体   繁体   中英

x509: certificate signed by unknown authority when building docker image

I have Dockerfile with the following content:

FROM tomcat:jre8
ADD https://nexus-instance/nexus/service/local/repositories/central/content/org/apache/activemq/activemq-core/5.7.0/activemq-core-5.7.0.jar $CATALINA_HOME/lib/

I want to add jar located in Nexus to the image

When I build the image, it ends up with:

Get https://nexus-instance/nexus/service/local/repositories/central/content/org/apache/activemq/activemq-core/5.7.0/activemq-core-5.7.0.jar: 
x509: certificate signed by unknown authority

I tried to add our local certificate into ubuntu store and can find the certificate in /etc/ssl/certs

  1. What things should one consider?

  2. Will docker engine installed on ubuntu host use certificates which are trusted ubuntu system-wide?

  3. Does Docker handle that in different way?

After all, I was missing restart of docker engine:

sudo systemctl restart docker

Once it is restarted, the service will pick up newly added certs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM