Error response from daemon: Get https://docker.elastic.co/v2/: x509: certificate signed by unknown authority

I did more research and fix this issue by this way:

(BTY, my OS is CentOS 7)

1 Get the certificate from Elastic docker registry (docker.elastic.co) by openssl:

# openssl s_client -connect docker.elastic.co:443 -showcerts

2 Copy the certificate content from -----BEGIN CERTIFICATE----- to -----END CERTIFICATE-----.

3 Create a new file with any name (e.g., cert.crt) under /etc/pki/ca-trust/source/anchors/, paste the above content.

4 Update certificate trust:

# update-ca-trust

5 Restart docker service (Don't forget this step)

# systemctl restart docker.service

6 Issue fixed:

# docker pull docker.elastic.co/elasticsearch/elasticsearch:7.14.0
7.14.0: Pulling from elasticsearch/elasticsearch
ddf49b9115d7: Pull complete
693712dd4782: Pull complete
e1843b23879c: Pull complete
43b0526f3562: Pull complete
395a8174c4c5: Pull complete
671bce37ebcd: Pull complete
7b0bb020b357: Pull complete
Digest: sha256:46815a329dfdf633cac9261e287c8440512db13554cbcb4fa89842dde58e74b2
Status: Downloaded newer image for docker.elastic.co/elasticsearch/elasticsearch:7.14.0
docker.elastic.co/elasticsearch/elasticsearch:7.14.0