Solve the problem of Mac Docker x509 certificate

Solve the problem of Mac Docker x509 certificate

question

Recently I needed to log in to a private mirror center, but an error message appeared when logging in:

Error response from daemon: Get https://***: x509: certificate signed by unknown authority

reason

The certificate of the private mirror center is not trustworthy, and you need to add the authentication certificate of the private mirror center.

Workaround

For example, if the authentication certificate of the private mirror center is ca.crt, execute the following command:

sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ca.crt

Just restart Docker.

Supplement: An article will help you solve the error when pulling images from Docker: x509: certificate has expired or is not yet valid

1. Problem Description

X509 error occurs when docker pulls the image:

2. Solution

When docker pulls an image, an x509 problem occurs. This is usually a certificate problem or a system time problem.

First check the time to see if it is correct. If the time does not match the actual time, it is usually a system time problem.

(1) Time problem solved: date error

Update time synchronization: ntpdate cn.pool.ntp.org

If the prompt says that the ntpdate command does not exist, you need to install it first: yum install ntpdate

After the time is updated, just pull it again:

(2) If it is a certificate problem, you need to edit the daemo.json file: vi /etc/docker/daemon.json

Add to the file:

{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}

Then restart the docker service: docker restart

The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me.

You may also be interested in:
  • How to add a certificate to docker
  • How to obtain a permanent free SSL certificate from Let''s Encrypt in Docker
  • Docker solution for logging in without root privileges
  • How to modify the root password of mysql in docker
  • How to change the root password in a container using Docker
  • How to obtain root permissions in a docker container

<<:  Use CSS to switch between dark mode and bright mode

>>:  Web Design Tutorial (1): Steps and Overall Layout

Recommend

Steps to package and release the Vue project

Table of contents 1. Transition from development ...

Examples of new selectors in CSS3

Structural (position) pseudo-class selector (CSS3...

CUDA8.0 and CUDA9.0 coexist under Ubuntu16.04

Preface Some of the earlier codes on Github may r...

Installation process of CentOS8 Linux 8.0.1905 (illustration)

As of now, the latest version of CentOS is CentOS...

CSS3 creates 3D cube loading effects

Brief Description This is a CSS3 cool 3D cube pre...

MySQL Tutorial: Subquery Example Detailed Explanation

Table of contents 1. What is a subquery? 2. Where...

How to build php+nginx+swoole+mysql+redis environment with docker

Operating system: Alibaba Cloud ESC instance cent...

The ultimate solution for writing bash scripts with nodejs

Table of contents Preface zx library $`command` c...

Detailed explanation of docker visualization graphics tool portainer

Table of contents 1. Introduction to Portainer 2....

Linux uses suid vim.basic file to achieve privilege escalation

Reproduce on Kali First set suid permissions for ...

Detailed explanation of various usages of proxy_pass in nginx

Table of contents Proxy forwarding rules The firs...

Detailed explanation of the use of shared memory in nginx

In the nginx process model, tasks such as traffic...

HTML Basic Notes (Recommended)

1. Basic structure of web page: XML/HTML CodeCopy...

How to install MySQL 5.7 on Ubuntu and configure the data storage path

1. Install MySQL This article is installed via AP...