Solve the Docker x509 insecure registry problem

Solve the Docker x509 insecure registry problem

After installing Docker, I encountered the x509 problem when I tried to pull from the private server Harbor built by the company. The reason for this problem is that Docker will verify the certificate of the website. The private server does not have the corresponding certificate, so Docker refuses to access. However, we can also allow Docker to connect to "unsafe" websites. Here is a solution:

Environment: Ubuntu 16.04, Docker CE 18.09

Modify or create a new configuration file:

sudo vim /etc/default/docker

Enter i to switch to edit mode, enter DOCKER_OPTS="--insecure-registry 127.0.0.1" (replace 127.0.0.1 with the URL you need to allow. If there is a port number, add the port number, such as 127.0.0.1:8080), :wq to save and exit:

DOCKER_OPTS="--insecure-registry 127.0.0.1"

Edit the docker service configuration file:

sudo vim /lib/systemd/system/docker.service

In command mode:/ExecStart, find ExecStart. My default ExecStart looks like this: ExecStart=/usr/bin/dockerd -H unix://

Add EnvironmentFile (note that there is a "-" before the file path name, I recommend copying my configuration directly) and modify ExecStart, save and exit:

EnvironmentFile=-/etc/default/docker
ExecStart=/usr/bin/dockerd -H unix:// $DOCKER_OPTS

Refresh the service configuration and restart Docker:

systemctl daemon-reload
service docker restart

After that, docker pull can be used normally.

Supplement: Docker 1.13.1 version adds --insecure-registry

Divide into three steps (add the content in the red box: the IP needs to be changed)

1. vi /etc/sysconfig/docker

2. vi /usr/lib/systemd/system/docker.service

3. vi /etc/docker/daemon.json

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:
  • Solve the problem of Mac Docker x509 certificate
  • Detailed explanation of how to configure openGauss database in docker
  • How to configure the pdflatex environment in docker
  • How to add a certificate to 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

<<:  CSS3 realizes the mask barrage function

>>:  Ten popular rules for interface design

Recommend

Implementation steps for installing java environment in docker

This article is based on Linux centos8 to install...

JavaScript implements click to change the image shape (transform application)

JavaScript clicks to change the shape of the pict...

MySQL 8.0.18 installation and configuration graphic tutorial

Learning objectives: Learn to use Windows system ...

Webpack file packaging error exception

Before webpack packaging, we must ensure that the...

MySQL implements an example method of logging in without a password

Specific method: Step 1: Stop the mysql service /...

Detailed explanation of command to view log files in Linux environment

Table of contents Preface 1. cat command: 2. more...

Docker implements cross-host container communication based on macvlan

Find two test machines: [root@docker1 centos_zabb...

Nginx reverse proxy springboot jar package process analysis

The common way to deploy a springboot project to ...

Implementation of ssh non-secret communication in linux

What is ssh Administrators can log in remotely to...

Specific method of viewing user authorization information in mysql

Specific method: 1. Open Command Prompt 2. Enter ...

Detailed explanation of Vue router routing guard

Table of contents 1. Global beforeEach 1. Global ...

Detailed use cases of vue3 teleport

Official Website https://cli.vuejs.org/en/guide/ ...

Graphic tutorial on configuring nginx file server in windows 10 system

Download the Windows version of Nginx from the Ng...

Answers to several high-frequency MySQL interview questions

Preface: In interviews for various technical posi...