Home>Article>Operation and Maintenance> How to solve the problem that docker cannot push to http

How to solve the problem that docker cannot push to http

WJ
WJ Original
2020-06-09 16:34:06 4350browse

How to solve the problem that docker cannot push to http

How to solve the problem that docker cannot push to http?

System environment: centos7

docker version: 1.12.3 (note the version, there may be different settings for different versions)

docker registry version :2.4.1

Question:

Successfully installed docker registry, entered http://192.168.1.100:5000/v2 in the browser, and successfully returned json data. When pushing to docker registry, it reports:

[root@master sysconfig]# docker push 192.168.1.100:5000/registry:2.4.1The push refers to a repository [192.168.1.100:5000/registry] Get https://192.168.1.100:5000/v1/_ping: http: server gave HTTP response to HTTPS client

This problem may be caused by the client using https and the docker registry not using https service. One way to deal with this is to change the client's request for the address "192.168.1.100:5000" to http.

Many articles currently solve this problem by modifying the docker configuration file "etc/systemconfig/docker" and restarting docker. However, it was found that docker version 1.12.3 did not have this file. I created this file online and filled in the corresponding content. Restarting docker had no effect and this error was still reported.

Solution:

Create the "daemon.json" file in the "/etc/docker/" directory. Write in the file:

{ "insecure-registries":["192.168.1.100:5000"] }

After saving and exiting, restart docker. Problem solved:

[root@master docker]# docker push 192.168.1.100:5000/registry:2.4.1The push refers to a repository [192.168.1.100:5000/registry] ee8e809cfde5: Pushed ba20d499f984: Pushed 705e35f12f24: Pushed 42755cf4ee95: Pushed2.4.1: digest: sha256:b66c4af9577744ae6d32e975808230e2ff558a5d50a7968d5102a900e147f3d5 size: 1158

window server 2016, the default installation docker configuration file is in "C:\ProgramData\docker\config\". You can create a "daemon.json" file in this directory to solve this problem.

Related references:docker tutorial

The above is the detailed content of How to solve the problem that docker cannot push to http. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn