Add Trusted CA to Debian / Ubuntu image

I am trying to deploy a CA certificate as a trusted root certificate in a Debian / nodejs container, as described in https://askubuntu.com/a/94861/88763 or http://blog.bigon.be/2014/03/22/add- a-new-ca-certificate-to-the-certificates-stash-in-debian / , but it does not work for no apparent reason. My Docker File:

FROM debian:jessie # or buildpack-deps:jessie or node:5
RUN apt-get update -y && \
    apt-get install ca-certificates netcat strace wget -y
ADD rootCa.pem /usr/local/share/ca-certificates/rootCa.crt
RUN update-ca-certificates --verbose

CMD ["netcat", "-l", "12345"] # just to keep the container running

When creating the container, it actually tells me that a certificate ( 1 added, 0 removed; done.) was added . However, when I try to use the root CA with wget, it is not found:

$ sudo docker exec -it cleanslatehg_catests_1 wget https://foo.v3.testing
converted 'https://foo.v3.testing' (ANSI_X3.4-1968) -> 'https://foo.v3.testing' (UTF-8)
--2016-02-02 15:11:33--  https://foo.v3.testing/
Resolving foo.v3.testing (foo.v3.testing)... 172.19.0.7
Connecting to foo.v3.testing (foo.v3.testing)|172.19.0.7|:443... connected.
ERROR: The certificate of 'foo.v3.testing' is not trusted.

Using the Ubuntu base image, I can access https: //foo.v3.testing successfully:

FROM ubuntu
RUN apt-get update -y && \
    apt-get install ca-certificates netcat strace wget -y
ADD rootCa.pem /usr/local/share/ca-certificates/rootCa.crt
RUN update-ca-certificates --verbose

CMD ["netcat", "-l", "12345"]

$ sudo docker exec -it cleanslatehg_catests_1 wget https://foo.v3.testing
--2016-02-02 15:23:17--  https://foo.v3.testing/
Resolving foo.v3.testing (foo.v3.testing)... 172.19.0.7
Connecting to foo.v3.testing (foo.v3.testing)|172.19.0.7|:443... connected.
HTTP request sent, awaiting response... 200 OK
[…]
2016-02-02 15:23:17 (33.9 MB/s) - 'index.html' saved [170/170]
+4

Source: https://habr.com/ru/post/1627044/


All Articles