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

Meta declaration annotation steps

Meta declaration annotation steps: 1. Sort out all...

MySQL 8.0.15 installation and configuration graphic tutorial

This article records the installation and configu...

MySQL 8.0.20 compressed version installation tutorial with pictures and text

1. MySQL download address; http://ftp.ntu.edu.tw/...

How to fill items in columns in CSS Grid Layout

Suppose we have n items and we have to sort these...

Solution to the conflict between nginx and backend port

question: When developing the Alice management sy...

Summary of Linux nc command

NC's full name is Netcat (Network Knife), and...

HTML+CSS to implement the sample code of the navigation bar drop-down menu

Effect The pictures in the code can be changed by...

Detailed explanation of Linux command unzip

Table of contents 1. unzip command 1.1 Syntax 1.2...

Real-time refresh of long connection on Vue+WebSocket page

Recently, the Vue project needs to refresh the da...

Docker primary network port mapping configuration

Port Mapping Before the Docker container is start...

How to choose between MySQL CHAR and VARCHAR

Table of contents VARCHAR and CHAR Types Conclusi...

How to completely delete the MySQL service (clean the registry)

Preface When installing the executable file of a ...

How to configure MySQL on Ubuntu 16.04 server and enable remote connection

background I am learning nodejs recently, and I r...