Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP/Insecure repository: http: server gave HTTP response to HTTPS client #28321

Closed
ktamiola opened this issue Nov 11, 2016 · 13 comments
Closed

HTTP/Insecure repository: http: server gave HTTP response to HTTPS client #28321

ktamiola opened this issue Nov 11, 2016 · 13 comments

Comments

@ktamiola
Copy link

@ktamiola ktamiola commented Nov 11, 2016

Description
I am trying to setup a local insecure repository on VM running Ubuntu 16.04.1 image. I have followed official configuration guide for local registry and created a daemon.json placed in /etc/docker/daemon.json. I have also modified the contents of /etc/default/docker according to manual. Unfortunately, no luck with plain HTTP repository. Help!

daemon.json

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

Command
I am attempting to connect from a different host (10.0.0.1, with full access permissions for 10.0.0.15) and push to 10.0.0.15:5000.

docker push 10.0.0.15:5000/peptone-rpc-controller

Error:

The push refers to a repository [10.0.0.15:5000/peptone-rpc-controller]
Get https://10.0.0.15:5000/v1/_ping: http: server gave HTTP response to HTTPS client

docker info

Containers: 2
 Running: 1
 Paused: 0
 Stopped: 1
Images: 1
Server Version: 1.12.3
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 19
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: host null bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-47-lowlatency
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 488.3 MiB
Name: peptone-registry
ID: EK2K:QGNT:4WSX:XFZ3:2LX6:2BR3:LUYV:2U66:4OCF:O4TZ:ZXWO:PY3X
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
 10.0.0.15:5000
 127.0.0.0/8

/etc/default/docker

# Docker Upstart and SysVinit configuration file

#
# THIS FILE DOES NOT APPLY TO SYSTEMD
#
#   Please see the documentation for "systemd drop-ins":
#   https://docs.docker.com/engine/articles/systemd/
#

# Customize location of Docker binary (especially for development testing).
#DOCKERD="/usr/local/bin/dockerd"

# Use DOCKER_OPTS to modify the daemon startup options.
DOCKER_OPTS="--insecure-registry 10.0.0.15:5000"

# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"

# This is also a handy place to tweak where Docker's temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp"
@ktamiola
Copy link
Author

@ktamiola ktamiola commented Nov 11, 2016

It seems the only way to set insecure registry flag is to add,

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

to /etc/docker/daemon.json. On Ubuntu 16.04.1 modifications to /etc/default/docker/ seem not to work for insecure registry.

@ktamiola ktamiola closed this Nov 11, 2016
@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Nov 18, 2016

Correct, that file is not used on systems using systemd as an init system; see the message at the top;

# THIS FILE DOES NOT APPLY TO SYSTEMD
#
#   Please see the documentation for "systemd drop-ins":
#   https://docs.docker.com/engine/articles/systemd/
#

So either use a daemon.json file, or use systemd drop-in files

@abhtibco
Copy link

@abhtibco abhtibco commented Jan 30, 2017

@ktamiola Thanks!! This solution works for Ubuntu16.04

@MikeMitterer
Copy link

@MikeMitterer MikeMitterer commented Feb 23, 2017

Had the same problem on Mac 10.11. It was not clear to me where to set the "insecure-registries" option on Mac. I think on Mac the /etc/docker/daemon.json is ignored but!! instead we have a nice GUI:
capturfiles-20170223_091129

Where kdeneon in this case is where the private registry runs.
Hope this helps someone!

@saavkaar
Copy link

@saavkaar saavkaar commented Mar 16, 2017

Try adding --insecure-registry option to daemon in /etc/systemd/system/docker.service.d/docker.conf file.
Then sudo systemctl daemon-reload
And sudo service docker restart

It worked for me

OS: Ubuntu 16.04
Docker: 1.26

@selfup
Copy link

@selfup selfup commented Oct 21, 2017

@MikeMitterer thanks for that screenshot! Works great 👍

@sweihub
Copy link

@sweihub sweihub commented Mar 11, 2019

It seems the only way to set insecure registry flag is to add,

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

to /etc/docker/daemon.json. On Ubuntu 16.04.1 modifications to /etc/default/docker/ seem not to work for insecure registry.

Saved my day on Ubuntu, thanks!

@binauyang
Copy link

@binauyang binauyang commented Jun 20, 2019

Had the same problem on Mac 10.11. It was not clear to me where to set the "insecure-registries" option on Mac. I think on Mac the /etc/docker/daemon.json is ignored but!! instead we have a nice GUI:
capturfiles-20170223_091129

Where kdeneon in this case is where the private registry runs.
Hope this helps someone!

Thanks, that's great!

@2efPer
Copy link

@2efPer 2efPer commented Jul 11, 2019

none of those works for me.

@SiNZeRo
Copy link

@SiNZeRo SiNZeRo commented Mar 23, 2020

gui works!

Had the same problem on Mac 10.11. It was not clear to me where to set the "insecure-registries" option on Mac. I think on Mac the /etc/docker/daemon.json is ignored but!! instead we have a nice GUI:
capturfiles-20170223_091129
Where kdeneon in this case is where the private registry runs.
Hope this helps someone!

Thanks, that's great!

@bgaillard
Copy link

@bgaillard bgaillard commented Jun 3, 2020

I recently performed several changes in my Docker configuration and was in a state where neith updating the /etc/docker/daemon.json nor passing the --insecure-registry option at daemon start command (i'm using Ubuntu and did it with sudo systemctl edit docker.service) worked.

I had to do the following to make it work again.

rm -Rf ~/.docker
sudo systemctl daemon-reload
sudo systemctl restart docker

So it seems I had some metadata files in ~/.docker which caused the problem (I recently tested several stuffs with Buildkit).

Hope this helps.

@stampeder
Copy link

@stampeder stampeder commented Jul 17, 2020

How does one get to the Docker gui in the mac?

@Markus-Lehr
Copy link

@Markus-Lehr Markus-Lehr commented May 25, 2021

none of those works for me.

I was having some trouble yesterday, because I missed a - probably obvious - part. I was using docker-compose to start my image, where I specified the wrong image name. Instead of [image]:[tag] (e.g. my-image:1.0.0) I needed to specify my private, insecure registry as well: [host]:[port]/[image]:[tag] (e.g. my.domain.com:8123/my-image:1.0.0).

Other than that, I added "insecure-registries" to the daemon.json and restarted docker, as already described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet